Society of Robots - Robot Forum

Software => Software => Topic started by: bootstrap on December 03, 2007, 09:47:38 AM

Title: Dev c++ compilation error
Post by: bootstrap on December 03, 2007, 09:47:38 AM
Hi ,
When I am compiling a .cpp file in Dev -C++ using certain image procesing class , I am getting the following errors:
[linker error] undefined reference to `SetDIBitsToDevice@48' 
ld returned 1 exit status 
How do i solve the errors.
I already gave
#include "CImg.h"
using namespace cimg_library;
in my source code..

Some one suggested me to do the following:
libgdi32 (just add -lgdi32 to your link options)
How shall i add this file and where is the link option in "Dev -C++ 4.9.9.2"?
Title: Re: Dev c++ compilation error
Post by: bootstrap on December 04, 2007, 03:43:32 AM
solved the problem
Title: Re: Dev c++ compilation error
Post by: Fredrik Andersson on December 04, 2007, 04:47:07 PM
Could you please post your solution. :)

It's good for people googling this particular error. They may find a link to this thread and the problem seems identically. Wouldn't it be great then if the solution could be find in this same thread? Just a tip.
Title: Re: Dev c++ compilation error
Post by: lepa on December 25, 2008, 11:54:13 AM
i have the same problem, there is anyone who know i should do?
Title: Re: Dev c++ compilation error
Post by: Len0 on October 03, 2009, 11:16:38 AM
I don't see that bootstrap edited his post to give solution to this problem. As it was suggested to him, you need to link libgdi32.
In Dev-C++ -> Project>>Project Options>>Parameters>>Add Lib>>libgdi32.a
In Code::Blocks -> Project>>Build Options>>Linker Settings>>Add>>libgdi32.a

I know this thread is old, but I hope someone will find my post useful. :)
Title: Re: Dev c++ compilation error
Post by: mamintoosi on July 03, 2010, 02:00:34 AM
Hi Len0;
Thanks; tho solution was useful for me.