Boost::regex causes runtime errors with CLR
Hi, I'm trying to use boost::regex with a "Windows Forms Application" in Visual Studio 2005. Everything works fine with normal C++, and even using a "CLR Console Application." But when I use the "Windows Form Application" template the program crashes while initializing variables. Basically I take code like: #include <boost/regex.hpp> using boost::regex; using boost::regex_search; bool h() { return regex_search("asdfasdf",regex("sd")); } put it in a separate file, turn off precompiled headers for that file, and never actually call h(). The program crashes instantly with a debug assertion failed at dbgheap.c/Line 1414/_CrtIsValidHeapPointer. The call stack looks like: ... msvcr80d.dll!__dllonexit(int (void)* func=0x00446110, void (void)* * * pbegin=0x0012eab8, void (void)* * * pend=0x0012eab0) Line 273 + 0x11 bytes C temp.exe!_onexit(int (void)* func=0x00446110) Line 110 + 0x11 bytes C temp.exe!atexit(void (void)* func=0x00446110) Line 127 + 0x9 bytes C temp.exe!boost::re_detail::`dynamic initializer for 'block_cache''() Line 189 + 0x2b bytes C++ ... It does this whether I compile the file with regex with the /clr flag or not (although the /clr flag gives a lot of errors, one of which isn't about converting fastcall to stdcall: include\boost/shared_ptr.hpp(92) : warning C4793: 'vararg' : causes native code generation for function 'void boost::detail::sp_enable_shared_from_this(const boost::detail::shared_count &,...)' Thanks, Rajib
participants (1)
-
Rajib