From: David E. <dav...@al...> - 2007-08-24 09:31:16
|
Danny Smith wrote: > >> -----Original Message----- >> From: min...@li... >> [mailto:min...@li...] On Behalf >> Of David Ergo >> Sent: Friday, 24 August 2007 8:02 p.m. >> To: min...@li... >> Subject: [Mingw-users] g++ 4.2.1 with shared libstdc++ not >> catching exceptions >> >> >> It seems that exceptions are not catched by g++ 4.2.1 when using the >> shared library version of libstdc++. >> >> Here is a small test case: >> >> $ cat testcase_exception.cpp >> #include <stdexcept> >> #include <stdio.h> >> >> int main() >> { >> try { >> throw std::runtime_error("hello, world"); >> } catch (const std::runtime_error &re) { >> fprintf(stderr, "%s\n", re.what()); >> } >> >> return 0; >> } >> >> >> > > Try g++-sjlj -shared-libgcc testcase_exception.cpp -lstdc++_s > I don't know how to force -shared-libgcc when linking against a shared > libstdc++, but it is generally required > I'll expand the release notes > $ g++-sjlj -shared-libgcc testcase_exception.cpp -lstdc++_s /mingw/lib/gcc/mingw32/../../../mingw32/bin/ld.exe: cannot find -lgcc_s collect2: ld returned 1 exit status $ find gcc421/ -name 'libgcc*' gcc421/bin/libgcc_sjlj_1.dll gcc421/lib/gcc/mingw32/4.2.1-sjlj/libgcc.a It seems that the libgcc_s.a import library is missing. David -- David Ergo Chief Software Engineer Alterface s.a. 8 chemin des étoiles B-1348 Louvain-la-Neuve Belgium Email: dav...@al... Voice: +32 (0)10 48.00.68 Fax: +32 (0)10 48.00.69 http://www.alterface.com |