Thursday, March 18, 2010

LNK2019 - Undefined External Symbol

LNK2019 errors are fun to track down. Nothing like "Undefined External Symbol" to strike fear in your mind.

LNK2019 means that one of the functions or classes that you are using cannot be found. Well duh, but why can't the linker find it?

So you have 2 projects. One is a static lib project, the other is using the static lib. When linking to the static lib, it can't find one of the functions or classes that you are using in your non static lib project.

First make sure that the project settings are looking in the right place for the static lib. Then use dumpbin.exe to analyze the static lib and make sure the symbols are actually defined in the static lib.

If you don't find the symbol your looking for in the output from dumpbin.exe, then take a look at your static lib. What is most likely happening is some of your functions have prototypes, but the actual implementation is missing. i.e. look for .cpp files that need to be added to the static lib, or actually code up the prototypes that are missing bodies.

Turn Text in Drupal to HTML

So you have some text in drupal, and you want it to be formatted with HTML. Use check_markup.