LNK2019

January 30, 2011

Every C++ dev gets bitten by unresolved symbols in their builds from time to time. You can stare at code for hours, sure that your library is defining a symbol. I just cracked one of these. Three methods in a lib were showing as unresolved when I built the exe. This stackoverflow entry was helpful, especially Raymond Chen’s blog entry which put me onto the undname utility. I’ve known about dumpbin for years, but undname was new to me. The problem turned out to be that one of my libs was built without the STLport headers on the include path. Visual Studio silently picks up its own STL. Then the linker complains it can’t resolve methods that return an std::string. The unresolved refs all had stlp_ in the signatures. Of course, I couldn’t see that until I compared methods defined in the lib using dumpbin /linkmembers:2 and undname with those unresolved by the linker.

Advertisements

2 Responses to “LNK2019”

  1. Max Says:

    Unrelated to this post, but this blog may be of interest to you: http://howtohft.blogspot.com/2011/02/how-to-build-fast-limit-order-book.html

  2. etrading Says:

    Thanks Max – that was a good one…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s