FAQ 5: SoftC and MFC Link Errors.

Linking SoftC and MFC Libraries

Linking your program with the MFC library can make subtle changes to your program build which are not obvious. When this is the case, you will need to choose the correct SoftC Library file to link with your program. 

For example you might see the following linker error following your build:

Linking...
dbfw.lib(FILE.OBJ) : error LNK2001: unresolved external symbol _errno
Debug/dbfw_test.exe : fatal error LNK1120: 1 unresolved externals

Under Visual C6.0, the global variable errno is defined as either a macro (Multi-threaded or DLL operation) or an integer (all other cases). As a result if we choose to use MFC (which enables multi-threaded operation) and then try to link with a non-multithreaded library errno will be defined differently in the SoftC Library file than in the application and the unresolved error will result.

To solve this problem a multi-threaded static library should be used with your MFC equipped application. Alternatively, you could use the DLL version of the SoftC Library as it is multi-threaded by definition.

Did you find this article useful? Please tell us.

Back to FAQs page.