Thread: new to visual C++ - "unresolved external symbol" linking errors

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Jan 2006
    Posts
    13
    Well, the problem turned out to be the mangling of my C function names... all I had to do was export the C functions using

    Code:
    #ifdef __cplusplus
    extern "C" {  
    #endif	
    
    //Declare C functions here
    
    #ifdef __cplusplus
    }
    #endif
    in my header files, and it all compiles and links fine now. Stupid mistake =/ Hopefully this helps someone having the same problem, though

  2. #2
    Registered User
    Join Date
    Apr 2006
    Location
    London
    Posts
    3
    Hiya, not sure if you're still checking this thread, but i seem to be having virtually the same problem as you were. i tried what you suggested and it reduced the length of the linker errors, but they still show up except instead of looking like:

    Code:
    SCFfunction.obj : error LNK2001: unresolved external symbol "int __cdecl fwrite_scf(struct Scf *,struct _iobuf *)" (?fwrite_scf@@YAHPAUScf@@PAU_iobuf@@@Z)
    they have been shortened to:

    Code:
    SCFfunction.obj : error LNK2001: unresolved external symbol _fwrite_scf
    now it just looks like i've simply forgotten to include a library, but i didn't change anything else. did you see anything like that at all? it's probably just something really simple that's eluding me.

    cheers

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Avoiding Global variables
    By csonx_p in forum Windows Programming
    Replies: 32
    Last Post: 05-19-2008, 12:17 AM
  2. multiple errors generated by socket headers
    By nocturna_gr in forum Windows Programming
    Replies: 5
    Last Post: 12-16-2007, 06:33 PM
  3. more then 100errors in header
    By hallo007 in forum Windows Programming
    Replies: 20
    Last Post: 05-13-2007, 08:26 AM
  4. We Got _DEBUG Errors
    By Tonto in forum Windows Programming
    Replies: 5
    Last Post: 12-22-2006, 05:45 PM
  5. <list>
    By Unregistered in forum C++ Programming
    Replies: 9
    Last Post: 02-24-2002, 04:07 PM