Thread: [Linker Error] Unresolved external

  1. #1
    Registered User
    Join Date
    Aug 2006
    Location
    Waddinxveen, Netherlands
    Posts
    5

    [Linker Error] Unresolved external

    Hi all,


    Since I did spit up my code into different units I got the following error:

    [Linker Error] Unresolved external '_GainValues' referenced from I:\C++_PROJECTS_JOHAN\NEMA_REVIEW\MAIN.OBJ

    Any help is very appreciated!

    Thanks in advance,

    Johan

  2. #2
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,210
    If you're using the command line to compile, are you compiling all of the .c or .cpp files before they are linked?

    If you're using an IDE, are all of the .c or .cpp files added to the project for sure?

    How are you compiling your project?

  3. #3
    Registered User
    Join Date
    Aug 2006
    Location
    Waddinxveen, Netherlands
    Posts
    5
    I use an IDE, Borland C++ Builder 6.0. The only thing I did was moving 5 procedures from the main program to a seperate unit. Before I moved the procedures to this unit everything worked fine.

    Johan

  4. #4
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,210
    The error indicates that somehow in your compiling, you're missing the .c file that actually implements GainValues(). Recheck your IDE's settings and make sure that that particular file is in the project's list of files to compile.

  5. #5
    Math wizard
    Join Date
    Dec 2006
    Location
    USA
    Posts
    582
    Either that, or add something like this:

    Code:
    #pragma comment(lib, "Winmm.lib") // adjust as needed
    at the top of your main file or at the top of your first included self-created header.
    High elevation is the best elevation. The higher, the better the view!
    My computer: XP Pro SP3, 3.4 GHz i7-2600K CPU (OC'd to 4 GHz), 4 GB DDR3 RAM, X-Fi Platinum sound, GeForce 460, 1920x1440 resolution, 1250 GB HDD space, Visual C++ 2008 Express

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiling sample DarkGDK Program
    By Phyxashun in forum Game Programming
    Replies: 6
    Last Post: 01-27-2009, 03:07 AM
  2. C++ std routines
    By siavoshkc in forum C++ Programming
    Replies: 33
    Last Post: 07-28-2006, 12:13 AM
  3. Including lib in a lib
    By bibiteinfo in forum C++ Programming
    Replies: 0
    Last Post: 02-07-2006, 02:28 PM
  4. Strange/false errors
    By Ganoosh in forum Windows Programming
    Replies: 8
    Last Post: 10-20-2005, 04:54 PM
  5. debug to release modes
    By DavidP in forum Game Programming
    Replies: 5
    Last Post: 03-20-2003, 03:01 PM