Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » MinGW can't find my windows API libraries("undefined reference to...")
MinGW can't find my windows API libraries [message #557878] Thu, 09 September 2010 06:20 Go to next message
Eclipse UserFriend
The below little test project demonstrates my problem. MinGW/cdt/Eclipse... well the linker, can't find the windows API libraries for *most* windows API functions (see CreateFontIndirect and DeleteObject below) whereas some function calls work fine (see MessageBox below)

I looked up CreateFontIndirect and DeleteObject functions in the MSDN library where it say the library needed is gdi32.lib. But if I search my eclipse\mingw directory I only find C:\devtools\eclipse\mingw\lib\libgdi32.a I'm not sure if that is the problem - - if I need to install more windows API libraries than what came with mingw wascana installation?

Any suggestions or comments would be very much appreciated. thanks

http://michellepace.com/temp/screenshot.eclipse.linker.problems2.gif

[Updated on: Thu, 09 September 2010 07:08] by Moderator

Re: MinGW can't find my windows API libraries [message #557897 is a reply to message #557878] Thu, 09 September 2010 07:28 Go to previous messageGo to next message
Eclipse UserFriend
Well, you need to tell the linker to link to the needed libraries. From the screenshot I suppose you are using the Makefiles createy by Eclipse. Then have a look here http://wiki.eclipse.org/CDT/User/FAQ#Adding_C.2FC.2B.2B_Exte rnal_Libraries how to do this.
icon14.gif  Re: MinGW can't find my windows API libraries [message #557936 is a reply to message #557897] Thu, 09 September 2010 09:52 Go to previous messageGo to next message
Eclipse UserFriend
thanks Axel Smile

I added -mwindows as an option to the gcc linker as well as the 'version' and 'winspool' libraries.

I HAVE A COMPILING PROGRAM!!!!!!!!! GOOD BYE BORLAND 2005!!!!!! Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy

http://michellepace.com/temp/fixed.gif

[Updated on: Thu, 09 September 2010 09:53] by Moderator

Re: MinGW can't find my windows API libraries [message #557939 is a reply to message #557936] Thu, 09 September 2010 10:04 Go to previous messageGo to next message
Eclipse UserFriend
Great!

Now I have a question Smile
How do you add images to your messages? The web interface does not allow me to attach anything.
Re: MinGW can't find my windows API libraries [message #558006 is a reply to message #557939] Thu, 09 September 2010 14:36 Go to previous messageGo to next message
Eclipse UserFriend
Quote:
How do you add images to your messages?


ha ha, sure Smile :

http://michellepace.com/temp/pic.of.pic.gif

Re: MinGW can't find my windows API libraries [message #558080 is a reply to message #557878] Fri, 10 September 2010 02:51 Go to previous message
Eclipse UserFriend
Thanks.
Previous Topic:Where to specify the location of shared library?
Next Topic:Can't find binary
Goto Forum:
  


Current Time: Wed Nov 05 05:25:29 EST 2025

Powered by FUDForum. Page generated in 0.09222 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top