Boost regex_replace vc6 ATL LNK1120
All, I am trying to incorporate the boost::regex into an ATL project that I am working on. Everything seems to work well until I try to use the regex_replace function. When I compile I get the following error: ===== Creating library Debug/yetan.lib and object Debug/yetan.exp test.obj : error LNK2001: unresolved external symbol "void __cdecl boost::throw_exception(class exception const &)" (?throw_exception@boost@@YAXABVexception@@@Z) Debug/yetan.dll : fatal error LNK1120: 1 unresolved externals Error executing link.exe. ====== I have created Non-ATL projects and everything seems to work fine. Any guidance or suggestions would be appreciated. Thanks, Rob
"Robert McKinnon"
I am trying to incorporate the boost::regex into an ATL project that I am working on. Everything seems to work well until I try to use the regex_replace function. When I compile I get the following error:
===== Creating library Debug/yetan.lib and object Debug/yetan.exp test.obj : error LNK2001: unresolved external symbol "void __cdecl boost::throw_exception(class exception const &)" (?throw_exception@boost@@YAXABVexception@@@Z)
I think it's related to the /GX or /EHsc compiler options. IIRC ATL 3 project wizards turn this options off by default (at the very least in the Min Dependency config) The easiest thing would be to compile with C++ exceptions support turned on. Please note, though, that this requires the CRT. Otherwise you're supposed to provide an implementation of boost::throw_exception. You could just terminate or raise a structured exception with Windows' RaiseException API. No unwinding happens in the latter case (that is object with automatic storage duration won't have their dtors called). -hg
I am trying to incorporate the boost::regex into an ATL project that I am working on. Everything seems to work well until I try to use the regex_replace function. When I compile I get the following error:
===== Creating library Debug/yetan.lib and object Debug/yetan.exp test.obj : error LNK2001: unresolved external symbol "void __cdecl boost::throw_exception(class exception const &)" (?throw_exception@boost@@YAXABVexception@@@Z) Debug/yetan.dll : fatal error LNK1120: 1 unresolved externals Error executing link.exe. ======
I have created Non-ATL projects and everything seems to work fine. Any guidance or suggestions would be appreciated.
You will see that if you have disabled exception handling in your project: in that case the lib doesn't know what to do when it needs to throw - so you need to provide your own error handler - see boost/detail/throw_exception.hpp for the signature - or turn on compiler exception support if you hadn't realised it was off :-) John.
participants (3)
-
Holger Grund
-
John Maddock
-
Robert McKinnon