[osg-users] [build] error LNK2019: unresolved external symbol "__declspec(dllimport)

Anastasia Papas hyper_pontia at hotmail.com
Thu Apr 14 07:29:23 PDT 2011

Hi, I am also getting a similar error for another lib, although I have added it at the linker input, when I build I get:

libboost_system-vc90-mt.lib(error_code.obj) : error LNK2019: unresolved external symbol __imp___invalid_parameter_noinfo referenced in function "public: virtual class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall `anonymous namespace'::system_error_category::message(int)const " (?message at system_error_category@?A0xa386b881@@UBE?AV?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@H at Z)

I found somewhere that this can be solved if we remove the msvcrt.lib from the Ignore Specific Library in Linker Input. I did that, but then although it builds, and I just get a warning:
warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library

But my project throws an exception:
Unhandled exception at 0x7c812afb in Template.exe: Microsoft C++ exception: std::bad_alloc at memory location 0x0012f32c..

And breaks at the file malloc.c at the command:
return HeapAlloc(_crtheap, 0, size ? size : 1);

I also found somewhere else to check the C/C++ -> Code Generation ->Runtime Library to be set Multi-threaded Debug DLL (/MDd) for Debug Mode and the equivalent for Release, and checked both my project, and the OSG installation project I used, and they are both set the same as this, so it's not that...

Does anyone have any other idea of how I could solve this error LNK2019: unresolved external symbol ?

Thank you!


Read this topic online here:

More information about the osg-users mailing list