Menu

New to Dev-C++: Linker Problems

alionsonny
2007-08-22
2012-09-26
  • alionsonny

    alionsonny - 2007-08-22

    Hi,
    I am new to Dev-C++ after working for several years with Borland and Microsoft-IDEs.

    I am running Dev-C++ 4.9.9.2 on Windows XP.

    Yesterday I tried to place a Toolbar into the GUI of my application and all compiled ok. But no Toolbar appeared. I learned, that I must call InitCommonControls() before using any comctrl-stuff.

    So I placed InitCommonControls() before any relevant calls. But then I got the following error:

    [Linker Error] undefined reference to InitCommonControls()@0

    I assumed that this must be because of the fact I used a rather outdated Windows-SDK. So I downloaded the latest Windows Plattform SDK from Microsoft, installed it in C:\PSDK.

    I changed the following settings in the CompilerOptions of Dev-C++ in the Directories-Tab:

    Added C:\PSDK\Bin to Programfiles
    Added C:\PSDK\Lib to Libraries
    Added C:\PSDK\Include to C-Includes

    But nothing changed. I still get the Linker-Error.

    Has anybody an idea why I get this linker-error and how to get rid of it?

    Thanks in advance

    Sonny

     
    • Wayne Keen

      Wayne Keen - 2007-08-22

      Sonny,

      Two steps - first, to learn the mechanics of linking libraries with GCC, there is a section in the thread titled "Please Read Before Posting a Question" on the compile log, including headers, and linking libraries - it is important to note that you MUST link the SPECIFIC library that you need - adding things to the search path is usually unneccessary, and does nothing to help.

      Next, this forum has a search capbaility - small box in the upper right of the web site - searching on "InitCommonControls" will give you a number of links that tell you which library you need to link.

      Wayne

      p.s. Note that code from the PSDK is not needed for this - and, because it is compiled by and for the Microsoft compiler, there is code that may not work with the GCC compiler

       
    • Anonymous

      Anonymous - 2007-08-22

      Win32 API libraries are supplied with Dev-C++ you don't need (and probably cannot use) the PSDK. But you do need to explicitly link the appropriate static libraries.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.