Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse CDT - problem linking to windows lib files

Tags:

I'm getting the folling linker errors when compiling with gcc:

undefined reference to `SetStretchBltMode@8' 
undefined reference to `StretchDIBits@52' 
undefined reference to `SetDIBitsToDevi

Are these functions defined in the windows libs?

If so do they come installed with Vista, or do I need to install them, and if so where can i download them.

Thanks

like image 603
chickeninabiscuit Avatar asked Jan 23 '09 01:01

chickeninabiscuit


2 Answers

Ok - worked this out:

libgdi32.a comes with mingw.

You need to add -lgdi32 to the g++ command!

Make sure that the path to mingw/lib is also provided to g++ eg: -Lc:/mingw/lib

like image 88
chickeninabiscuit Avatar answered Nov 28 '22 03:11

chickeninabiscuit


I know you solved your problem long ago, but for reference, I think you should be able to run g++ with -mwindows and that'll link gdi32.dll and comdlg32.dll with your binary automatically.

This page has a tutorial for Win32 on MinGW

like image 31
Morten Jensen Avatar answered Nov 28 '22 05:11

Morten Jensen