Thread: Dev c++ linker

  1. #1
    Registered User
    Join Date
    Jan 2010
    Posts
    5

    Dev c++ linker

    How do I link a library file in Dev c++?

  2. #2
    Registered User
    Join Date
    Dec 2006
    Location
    Scranton, Pa
    Posts
    252
    Right click on your project (left window), choose project options, browse and select the needed library (to link up with).

  3. #3
    Registered User kryptkat's Avatar
    Join Date
    Dec 2002
    Posts
    638
    i believe you are looking for the .a in the lib directory. meow.

  4. #4
    Registered User
    Join Date
    Jan 2010
    Posts
    5

    Not linking

    I went to the projects options and click on the Parameters tab. Add a the library, but came
    back with an [Build Error] [file.exe] Error 1. Also is in the MakeFile.win.

    Not sure if this helps, but I'm trying to link a .a library.

    I tried placing a copy in Dev's library directory it was still unsuccessful at linking the library.
    Last edited by newbe; 01-16-2010 at 01:54 PM.

  5. #5
    Registered User
    Join Date
    Oct 2006
    Location
    Canada
    Posts
    1,243
    I dont use DevC++, so Im not familiar with the IDE's interface. Are you making sure your linking statically, since .a usually means its a static library, while .so or .dll means dynamic library.

    If your code is short enough, especially if your using only standard stuff (that I and others on Linux could immediately test without additional software), I would suggest to post it so we can try it out.

  6. #6
    Registered User
    Join Date
    Dec 2006
    Location
    Scranton, Pa
    Posts
    252
    Quote Originally Posted by newbe View Post
    I went to the projects options and click on the Parameters tab. Add a the library, but came
    back with an [Build Error] [file.exe] Error 1. Also is in the MakeFile.win.

    Not sure if this helps, but I'm trying to link a .a library.

    I tried placing a copy in Dev's library directory it was still unsuccessful at linking the library.
    Nah, that's not right. You want the project options general tab, not the parameter's tab. If necessary, rebuild your project from scratch, meaning goto menu, create new project, select app. type (ie. console, win32), that'll create a barebones main.cpp file. If all you're dealing with is one main code file, simply copy n' paste over the main.cpp file (do any includes, or add resource file if needed thru the menu option, add resource file) then save your project.

    Then reopen with the project file, goto menu, project options; under general tab, you'll see the button add/browse library (or object) button. Select desired file, click ok. Link is done, save and compile (you'll be prompted to save before compiling the project). If you get a linking error (during failed compilation attempt), then it's likely you're in need of another library as well or in lieu of the one earlier selected. ..

  7. #7
    Registered User kryptkat's Avatar
    Join Date
    Dec 2002
    Posts
    638
    i add to projects libstdc++.a because it covers iostream and std stuff

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. linker error dev c++
    By manish_fra in forum C++ Programming
    Replies: 2
    Last Post: 12-11-2008, 11:07 AM
  2. Linker Problem with Dev C++
    By Brownie in forum C++ Programming
    Replies: 2
    Last Post: 09-26-2008, 07:18 AM
  3. Linker errors in Dev C++
    By tezcatlipooca in forum C++ Programming
    Replies: 12
    Last Post: 01-02-2007, 08:32 PM
  4. Linker error in Dev Cpp (DX)
    By C+noob in forum Game Programming
    Replies: 2
    Last Post: 08-15-2005, 03:13 AM
  5. Dev C++ linker error: undefined reference
    By josh_d in forum Windows Programming
    Replies: 11
    Last Post: 03-11-2004, 11:58 AM

Tags for this Thread