[system] Link error using __stdcall

I'm using VC2008 to build a library which uses boost::system. This library is then used in a COM DLL. When I build the COM DLL in 'Release mode' I get these link errors: ----------------------------------------- EuroATLib.lib(EuroATLib.obj) : error LNK2001: unresolved external symbol "class boost::system::error_category const & __stdcall boost::system::get_system_category(void)" (?get_system_category@system@boost@@YGABVerror_category@12@XZ) EuroATLib.lib(EuroATLib.obj) : error LNK2001: unresolved external symbol "class boost::system::error_category const & __stdcall boost::system::get_generic_category(void)" (?get_generic_category@system@boost@@YGABVerror_category@12@XZ) EuroATLib.lib(ATDispatcher.obj) : error LNK2001: unresolved external symbol "bool __stdcall boost::this_thread::interruptible_wait(void *,struct boost::detail::timeout)" (?interruptible_wait@this_thread@boost@@YG_NPAXUtimeout@detail@2@@Z) ----------------------------------------- I think the problem is in the calling convention that in COM is __stdcall while the boost::system uses __cdecl. What I don't understand is why when I build the COM DLL in 'Debug mode' it works! I've checked the VC linker settings and it seems ok. Any suggestions? Thanks, Daniele.

What I don't understand is why when I build the COM DLL in 'Debug mode' it works!
Probably, because you've got different default calling conventions in Debug and Release modes. In project properties go to "Configuration properties"-->"C/C++"-->"Advanced"-->Calling convention.

Igor R ha scritto:
What I don't understand is why when I build the COM DLL in 'Debug mode' it works!
Probably, because you've got different default calling conventions in Debug and Release modes. In project properties go to "Configuration properties"-->"C/C++"-->"Advanced"-->Calling convention.
Hi Igor, my misunderstood is exactly this! The calling convention is set to __cdecl in both configurations!! These are the command lines: DEBUG COMPILER: /Od /I "..\include" /I "G:\lib\boost_1_39_0" /D "WIN32" /D "_WINDOWS" /D "_DEBUG" /D "_USRDLL" /D "_MERGE_PROXYSTUB" /D "_WIN32_DCOM" /D "_WINDLL" /D "_ATL_DLL" /D "_UNICODE" /D "UNICODE" /Gm /EHsc /RTC1 /MDd /Yu"stdafx.h" /Fp"Debug\AxEuroATLib.pch" /Fo"Debug\\" /Fd"Debug\vc90.pdb" /W3 /nologo /c /ZI /TP /errorReport:prompt DEBUG LINKER: /OUT:"g:\src\Eurocom\Ax_TETRA\EuroATLib\AxEuroATLib\\Bin\AxEuroATLib.dll" /INCREMENTAL /NOLOGO /LIBPATH:"..\lib\static" /LIBPATH:"G:\lib\boost_1_39_0\stage\lib" /DLL /MANIFEST /MANIFESTFILE:"Debug\AxEuroATLib.dll.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEF:".\AxEuroATLib.def" /DEBUG /PDB:"g:\src\Eurocom\Ax_TETRA\EuroATLib\AxEuroATLib\Bin\AxEuroATLib.pdb" /SUBSYSTEM:WINDOWS /DYNAMICBASE /NXCOMPAT /MACHINE:X86 /ERRORREPORT:PROMPT uuid.lib EuroATLibd.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib RELEASE COMPILER: /O2 /I "..\include" /I "G:\lib\boost_1_39_0" /D "WIN32" /D "_WINDOWS" /D "NDEBUG" /D "_USRDLL" /D "_MERGE_PROXYSTUB" /D "_WIN32_DCOM" /D "_WINDLL" /D "_ATL_DLL" /D "_UNICODE" /D "UNICODE" /FD /EHsc /RTC1 /MD /Yu"stdafx.h" /Fp"Release\AxEuroATLib.pch" /Fo"Release\\" /Fd"Release\vc90.pdb" /W3 /nologo /c /Zi /TP /errorReport:prompt RELEASE LINKER: /OUT:"g:\src\Eurocom\Ax_TETRA\EuroATLib\AxEuroATLib\\Bin\AxEuroATLib.dll" /INCREMENTAL /NOLOGO /LIBPATH:"..\lib\static" /LIBPATH:"G:\lib\boost_1_39_0\stage\lib" /DLL /MANIFEST /MANIFESTFILE:"Release\AxEuroATLib.dll.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEF:".\AxEuroATLib.def" /DEBUG /PDB:"g:\src\Eurocom\Ax_TETRA\EuroATLib\AxEuroATLib\Bin\AxEuroATLib.pdb" /SUBSYSTEM:WINDOWS /OPT:REF /OPT:ICF /DYNAMICBASE /NXCOMPAT /MACHINE:X86 /ERRORREPORT:PROMPT uuid.lib EuroATLib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
participants (2)
-
Daniele Barzotti
-
Igor R