2010-09-08 6 views
2
boost::regex re("^\\s*([_\\w\\.]+)\\s*=\\s*([^\\s]+)$"); 
if(re.empty()){ 
    std::cout<<"How is this possible?"<<std::endl; 
} 

Cette ligne s'imprime dans mes versions de version! (Le debug sont très bien) Travailler avec MSVC 2008 (vc 9.0)boost :: regex se comporte différemment sur les versions de débogage et de publication

Options du compilateur pour DEBUG:

/Od /I "C:\Program Files\boost\boost_1_44_0" /I "C:\gtest-1.5.0\include" /I "include" /I "include\EMP" /I "dependencies\EMP\include" /I "dependencies\APR\apr-1.3.3\include" /I "dependencies\solclient_5.0.0.22\include" /I "dependencies\SS66\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "EMP_WIN_X86_32" /D "_iso_stdcpp_" /D "_CRT_SECURE_NO_DEPRECATE" /D "_SECURE_SCL=0" /D "_EMPAPI_STATIC_BUILD" /D "_EMPAPI_STATIC_LINK" /D "_UNICODE" /D "UNICODE" /Gm /EHsc /RTC1 /MDd /fp:fast /Fo"Debug\" /Fd"Debug\vc90.pdb" /W3 /nologo /c /ZI /TP /errorReport:prompt

Options du compilateur pour RELEASE:

/O2 /Oi /GL /I "C:\Program Files\boost\boost_1_44_0" /I "C:\gtest-1.5.0\include" /I "include" /I "include\EMP" /I "dependencies\EMP\include" /I "dependencies\APR\apr-1.3.3\include" /I "dependencies\solclient_5.0.0.22\include" /I "dependencies\SS66\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "EMP_WIN_X86_32" /D "_iso_stdcpp_" /D "_CRT_SECURE_NO_DEPRECATE" /D "_SECURE_SCL=0" /D "_EMPAPI_STATIC_BUILD" /D "_EMPAPI_STATIC_LINK" /D "_UNICODE" /D "UNICODE" /FD /EHsc /MD /Gy /fp:fast /Fo"Release\" /Fd"Release\vc90.pdb" /W3 /nologo /c /Zi /TP /errorReport:prompt

options Linker pour DEBUG:

/OUT:"C:\WorkFlow\cpp_client_library\Debug\cpp_client_library.exe" /INCREMENTAL /NOLOGO /LIBPATH:"C:\WorkFlow\cpp_client_library\workflow_client_cpp\dependencies\APR\apr-1.3.3\Release" /LIBPATH:"C:\WorkFlow\cpp_client_library\workflow_client_cpp\dependencies\EMP\lib\win32_vc80" /LIBPATH:"C:\WorkFlow\cpp_client_library\workflow_client_cpp\dependencies\solclient_5.0.0.22\lib" /LIBPATH:"C:\WorkFlow\cpp_client_library\workflow_client_cpp\dependencies\SS66\lib\i86_w32" /LIBPATH:"C:\Program Files\boost\boost_1_44_0\stage\lib" /LIBPATH:"C:\gtest-1.5.0\msvc\gtest\Debug" /MANIFEST /MANIFESTFILE:"Debug\cpp_client_library.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"c:\WorkFlow\cpp_client_library\Debug\cpp_client_library.pdb" /SUBSYSTEM:CONSOLE /DYNAMICBASE /NXCOMPAT /MACHINE:X86 /ERRORREPORT:PROMPT emp.lib libsolclient.lib tipc.lib tutil.lib gtestd.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

Linker Options pour RELEASE:

/OUT:"C:\WorkFlow\cpp_client_library\Release\cpp_client_library.exe" /INCREMENTAL:NO /NOLOGO /LIBPATH:"C:\WorkFlow\cpp_client_library\workflow_client_cpp\dependencies\APR\apr-1.3.3\Release" /LIBPATH:"C:\WorkFlow\cpp_client_library\workflow_client_cpp\dependencies\EMP\lib\win32_vc80" /LIBPATH:"C:\WorkFlow\cpp_client_library\workflow_client_cpp\dependencies\solclient_5.0.0.22\lib" /LIBPATH:"C:\WorkFlow\cpp_client_library\workflow_client_cpp\dependencies\SS66\lib\i86_w32" /LIBPATH:"C:\Program Files\boost\boost_1_44_0\stage\lib" /LIBPATH:"C:\gtest-1.5.0\msvc\gtest\Release" /MANIFEST /MANIFESTFILE:"Release\cpp_client_library.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"c:\WorkFlow\cpp_client_library\Release\cpp_client_library.pdb" /SUBSYSTEM:CONSOLE /OPT:REF /OPT:ICF /LTCG /DYNAMICBASE /NXCOMPAT /MACHINE:X86 /ERRORREPORT:PROMPT emp.lib libsolclient.lib tipc.lib tutil.lib gtest.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

+0

ayant le même problème avec violation d'accès – JXITC

+0

@JXITC, avez-vous extrayez l'explication donnée à \t svn.boost.org/trac/boost/ticket/768?Citant- "Après une longue enquête avec le même problème (crash à la sortie du programme lors de l'utilisation de regex), j'ai trouvé que le problème était dû au mélange des versions VC++ 2005: la bibliothèque était compilée avec VC++ 2005 sans SP1 et le programme était compilé avec VC++ 2005 avec SP1 Lorsque j'ai compilé la bibliothèque avec VC++ 2005 avec SP1, le problème avait disparu. " –

Répondre

0

je me suis déplacé à l'aide de Visual Studio 2005 et le problème a disparu mais je reçois maintenant une exception près de la fin de l'application:

exception non gérée à 0x0042d935 dans myApp.exe: 0xC0000005: violation d'accès l'emplacement de lecture 0xe06d7390.

La pile d'appel est

kernel32.dll! 7c812afb()
[Cadres ci-dessous peuvent être incorrectes et/ou manquant, pas de symboles chargés pour kernel32.dll]
kernel32.dll! 7c812afb()
msvcp80.dll! 7c421201()
msvcp80.dll! 7c42394d()
msvcp80.dll! 7c423958()
msvcr80.dll! 78158e89()
MyApp.exe! std :: _ Arbre, std :: allocateur>, std :: less, std :: tout ocator, std :: allocateur>>>, 0>> :: efface (std :: _ Arbre, std :: allocateur>, std :: moins, std :: allocateur, std :: allocateur>>, 0>>: : itérateur _Where = {...}) Ligne 759
msvcr80.dll! 78134c39()
myApp.exe! std :: _ Arbre, std :: allocateur>, std :: moins, std :: allocateur, std: : allocateur>>>,>> :: efface (std :: _ Arborescence, std :: allocateur>, std :: moins, std :: allocateur, std :: allocateur>>>, 0>> :: iterator _First = {...}, std :: _ Arbre, std :: allocateur>, std :: moins, std :: allocateur, std :: allocateur>>>, 0>> :: iterator _Last = {...}) Ligne 926 + 0x4F octets MyApp.exe! boost :: re_detail :: :: ~ w32_regex_traits_implementation w32_regex_traits_implementation() + 0xC0 octets
MyApp.exe! boost :: :: détails sp_counted_impl_p> :: disposer() + 0xf octets
myApp .exe! std :: liste const>, non signé long const * >, std :: allocator const>, sans signe long const *>>> :: clear() + 0x3e octets myApp.exe! boost :: object_cache> :: données :: ~ data() + 0x6b octets msvcr80.dll ! 781319d8()
msvcr80.dll! 78131a4b()
MyApp.exe! __ tmainCRTStartup() ligne 603 kernel32.dll! 7c817077()

+0

https://svn.boost.org/trac/boost/ticket/768 –

Questions connexes