What is up.
RSS icon Email icon Home icon
  • unresolved externals and function signatures

    Posted on June 2nd, 2009 Alan No comments

    Build issues can be extremely aggravating and hard to track down.  I spent quite a bit of time  tracking down a link error where everything seemed in order.  Function declaration and implementation of a library function matched the call in my application.  After much trial and error I decided to get forensic on the compiler.  I looked at the mangled function signature of the  library file (dropped the .lib file into Visual Studio) and compared it with the mangled function signature in the output window where it was reporting an unresolved external.  I used the command line program undname to show me the user-friendly function signatures and the difference was one used __cdecl and the other used __stdcall.  I was then able to find that my application was using the C/C++…Advanced…Calling Convention…__stdcall (/Gz) whereas the library was using __cdecl (/Gd).  Comparing file signatures between what was actually compiled into the library and what is expected in the application can expose several inconsistant settings. Another one might be the General…Character Set settings.

    Leave a reply

    You must be logged in to post a comment.