error LNK2001: unresolved external symbol

This is a discussion on error LNK2001: unresolved external symbol within the C++ Programming forums, part of the General Programming Boards category; I am compiling code from someone else which was done on MSVC++ but I get, for example, error LNK2001: unresolved ...

  1. #1
    Registered User
    Join Date
    Jan 2005
    Posts
    20

    error LNK2001: unresolved external symbol

    I am compiling code from someone else which was done on MSVC++ but I get, for example,

    error LNK2001: unresolved external symbol _get_app_size

    However the "get_app_size" is in the code. I compiled all the files individually and they have no errors BUT I cannot get a clean build. I read the MS Developers Network page about LNK2001, which doesn’t help me. Anyone know if there is a different way to build this into .exe file?

    Matt

  2. #2
    Registered User
    Join Date
    Aug 2005
    Posts
    1,267
    what version of VC++ are you using?

    Is get_app_size() in a *.cpp file or *.c file? If in *.c file, is it being called from somewhere inside *.cpp file? If yes, did you prototype it in the *.cpp file with extern "C"
    Code:
    // *.cpp file
    
    extern "C" void get_app_size(); // put whatever parameters are needed here

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, 02: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, 01:28 PM
  4. Stupid compiler errors
    By ChrisEacrett in forum C++ Programming
    Replies: 9
    Last Post: 11-30-2003, 04:44 PM
  5. debug to release modes
    By DavidP in forum Game Programming
    Replies: 5
    Last Post: 03-20-2003, 02:01 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21