exception mechanism of boost.regex conflicts with QT lib.
a short piece of code: ///////////////////////////////////// boost::regex reg;; try { reg.assign( "[]d"); } catch(std::runtime_error &e) { //exception } ////////////////////////// this code runs well in Eclipse with MingW. When I copy this code in my QT project and run, it seems that QT lib cannot handle the exception which boost.regex lib throws. A run time termination warning shows as a result. I'm using win7 64bit. My QT is integrated with MingW 4.4 . Did any one encounter a similar problem? Could someone help me ?
I'm using a static lib build of boost.regex. by the way, have you tried
boost.regex in QT ?
2011/11/24 John Maddock
Did any one encounter a similar problem? Could someone help me ?
No.... but try linking to a static lib build of Boost.Regex and see if that helps.
John. ______________________________**_________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/**mailman/listinfo.cgi/boost-**usershttp://lists.boost.org/mailman/listinfo.cgi/boost-users
cat fa wrote:
I'm using a static lib build of boost.regex. by the way, have you tried boost.regex in QT ?
We succesfully use boost 1.47.0 regex with Qt 4.6.3 with MSVC 8.
2011/11/24 John Maddock
mailto:boost.regex@virgin.net> Did any one encounter a similar problem? Could someone help me ?
No.... but try linking to a static lib build of Boost.Regex and see if that helps.
John.
By the way, please don't top post. What exactly do you mean by: "QT lib cannot handle the exception which boost.regex lib throws" ? Jeff
It's SOLVED.
Finally I found the problem. It’s because boost.regex and my QT project was
built under different version of gcc.
My regex was built under gcc 4.6. The default gcc which qt implements is
gcc 4.4. So gcc 4.4 cannot handle the exception from libs built under gcc
4.6.
When I set the Path in Build Settings-> Build Environment, indicated qt
compiler to find my gcc 4.6, everything is right.
Still I got a warning:
:-1: warning: cannot find entry symbol nable-stdcall-fixup; defaulting to
00401000
I didn't top post deliberately. I just replied in Gmail.
2011/11/27 Jeff Flinn
cat fa wrote:
I'm using a static lib build of boost.regex. by the way, have you tried boost.regex in QT ?
We succesfully use boost 1.47.0 regex with Qt 4.6.3 with MSVC 8.
2011/11/24 John Maddock
boost.regex@virgin.net**>>
Did any one encounter a similar problem? Could someone help me ?
No.... but try linking to a static lib build of Boost.Regex and see if that helps.
John.
By the way, please don't top post.
What exactly do you mean by: "QT lib cannot handle the exception which boost.regex lib throws" ?
Jeff
______________________________**_________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/**mailman/listinfo.cgi/boost-**usershttp://lists.boost.org/mailman/listinfo.cgi/boost-users
2011/11/28 Will Mason
Hello,
On Sat, Nov 26, 2011 at 11:13 PM, cat fa
wrote: <snip>
I didn't top post deliberately. I just replied in Gmail.
I am just replying in Gmail, too. Gmail does not enforce top posting.
Thank you, Will
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Could you tell me how to set in Gmail so that my reply doesn't top post?
On Sun, Nov 27, 2011 at 6:13 AM, cat fa
My regex was built under gcc 4.6. The default gcc which qt implements is gcc 4.4. So gcc 4.4 cannot handle the exception from libs built under gcc 4.6.
It's not like that. Unfortunately, it's much more complex than that. Depending on the MinGW flavor you download, it will use dwarf2 or sjlj exception unwind. They are not compatible. One is faster but does not work with VC++-compiled binaries (it won't catch the exceptions), the other is slower but works with VC++-compiled binaries. They are both just workarounds for the actual solution, which is a working implementation of Microsoft's SEH. That means if compile boost with gcc 4.4 sjlj and Qt with gcc 4.4 dwarf2, you will still see the problem. Same for 4.6. The current solution is to use always the same exception-flavor, be it dwarf2 (faster) or sjlj (compatible with VC++). The latter is preferred these days. -- Pau Garcia i Quiles http://www.elpauer.org (Due to my workload, I may need 10 days to answer)
Depending on the MinGW flavor you download, it will use dwarf2 or sjlj exception unwind. They are not compatible. One is faster but does not work with VC++-compiled binaries (it won't catch the exceptions), the
For completeness: it won't catch across-boundaries exceptions (i. e. exceptions thrown from one DLL but catched in another DLL or executable). -- Pau Garcia i Quiles http://www.elpauer.org (Due to my workload, I may need 10 days to answer)
participants (5)
-
cat fa
-
Jeff Flinn
-
John Maddock
-
Pau Garcia i Quiles
-
Will Mason