unresolved externals and function signatures

unresolved externals and function signatures

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