From: klaas.holwerda <ng...@kl...> - 2007-03-30 16:07:31
|
Hi, After days of searching i finally discovered the reason behind the error this: [klaas@dhcppc2 editmdi]$ ./sample_editor_editmdi 17:57:41: Debug: ./src/common/object.cpp(244): assert "sm_classTable->Get(m_className) == NULL" failed in Register(): Class "wxProcess" already in RTTI table - have you used IMPLEMENT_DYNAMIC_CLASS() multiple times or linked some object file twice)? ./src/common/object.cpp(244): assert "sm_classTable->Get(m_className) == NULL" failed in Register(): Class "wxProcess" already in RTTI table - have you used IMPLEMENT_DYNAMIC_CLASS() multiple times or linked some object file twice)? Trace/breakpoint trap As you see it complains about wxProcess RTTI, but WHY?? So i discovered that to make it go away is linking wxstedit in as static and not shared. E.g. In the following linking line changing -Wl,-Bdynamic -lwxcode_gtk2d_stedit-2.8 into -Wl,-Bstatic -lwxcode_gtk2d_stedit-2.8 Makes it work fine. (order/place of the wxstedit lib does not matter, also linking wxLua static or shared makes no difference. It comes back to wxstedit linking shared. I can not tell why this is, but i think i better let it know here, since it was hard to find. To bad cmake chooses shared libraries in favor of static libs, so i don't have a solution yet. regards, Klaas [klaas@dhcppc2 editmdi]$ /usr/bin/c++ -fPIC "CMakeFiles/sample_editor_editmdi.dir/editmdi.o" -o sample_editor_editmdi -rdynamic -L/home/klaas/wxwin/buildart/lib -L/home/klaas/wxwin/wxLua/lib -L/usr/local/lib -L/home/klaas/wxwin/wxCode/components/wxstedit/lib -L/home/klaas/wxwin/buildart/lib/ -Wl,-Bdynamic -lwxcode_gtk2d_stedit-2.8 -Wl,-Bstatic -lwxart2d_gtk2d_aggdrawer-2.8 -lwxart2d_gtk2d_curves-2.8 -lwxart2d_gtk2d_editor-2.8 -lwxart2d_gtk2d_canextobj-2.8 -lwxart2d_gtk2d_canvas-2.8 -lwxart2d_gtk2d_artbase-2.8 -lwxart2d_gtk2d_docview-2.8 -lwxart2d_gtk2d_svgio-2.8 -lwxart2d_gtk2d_gdsio-2.8 -lwxart2d_gtk2d_keyio-2.8 -lwxart2d_gtk2d_xmlparse-2.8 -lwxart2d_gtk2d_general-2.8 -lwxart2d_gtk2d_luawraps-2.8 -lkbool -Wl,-Bdynamic -lwxlua_gtk2d_wxluadebug-2.8 -lwxlua_gtk2d_wxluasocket-2.8 -lwxlua_gtk2d_wxlua-2.8 -lwxlua_gtk2d_wxbind-2.8 -lwxlua_gtk2d_wxbindstc-2.8 -llua5.1 -Wl,-Bdynamic -lexpat -Wl,-Bstatic -lantigrain -Wl,-Bdynamic `/usr/bin/freetype-config --libs` -L/usr/local/lib -pthread -Wl,-Bstatic -lwx_gtk2d_stc-2.8 -lwx_gtk2d_qa-2.8 -lwx_gtk2d_xrc-2.8 -lwx_gtk2d_html-2.8 -lwx_gtk2d_adv-2.8 -lwx_based_xml-2.8 -lwx_based_net-2.8 -lwx_gtk2d_core-2.8 -lwx_based-2.8 -Wl,-Bdynamic -lexpat -L/lib -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -lXinerama -lXxf86vm -lSM -lpng -ljpeg -ltiff -lz -ldl -lm -Wl,-Bdynamic -lfreetype -Wl,-rpath,/home/klaas/wxwin/buildart/lib:/home/klaas/wxwin/wxLua/lib:/usr/local/lib:/home/klaas/wxwin/wxCode/components/wxstedit/lib:/home/klaas/wxwin/buildart/lib/ |
From: Francesco M. <f18...@ya...> - 2007-04-02 19:41:08
|
klaas.holwerda ha scritto: > Hi, > > After days of searching i finally discovered the reason behind the error > this: > > [klaas@dhcppc2 editmdi]$ ./sample_editor_editmdi > 17:57:41: Debug: ./src/common/object.cpp(244): assert > "sm_classTable->Get(m_className) == NULL" failed in Register(): Class > "wxProcess" already in RTTI table - have you used > IMPLEMENT_DYNAMIC_CLASS() multiple times or linked some object file twice)? very strange. This may need investigation: could it be because of some incorrect RTTI usage? > E.g. In the following linking line changing -Wl,-Bdynamic > -lwxcode_gtk2d_stedit-2.8 into -Wl,-Bstatic -lwxcode_gtk2d_stedit-2.8 > Makes it work fine. (order/place of the wxstedit lib does not matter, > also linking wxLua static or shared makes no difference. > It comes back to wxstedit linking shared. I'm not sure to understand... but as you say this is probably related to cmake's default behaviour of putting -Wl,-Bdynamic flag in the linker line: From ld docs: -Bstatic -dn -non_shared -static Do not link against shared libraries. This is only meaningful on platforms for which shared libraries are supported. The different variants of this option are for compat‐ ibility with various systems. You may use this option multiple times on the command line: it affects library searching for -l options which follow it. This option also implies --unresolved-symbols=report-all. This option can be used with -shared. Doing so means that a shared library is being created but that all of the library’s external references must be resolved by pulling in entries from static libraries. which seems to mean that it tells to ld to use static libs to resolve _all_ symbols. Francesco |
From: klaas.holwerda <ng...@kl...> - 2007-04-03 21:50:08
|
Francesco Montorsi wrote: > very strange. This may need investigation: could it be because of some > incorrect RTTI usage? > I am not using wxProcess anywhere i know of. > > which seems to mean that it tells to ld to use static libs to resolve > _all_ symbols. > Yes, so what? -Bstatic and -Bdynamic are used both, so its a mix generated by Cmake, if it finds a dynamic version , it will use that, else the static flag. Maybe this mix does not combine well, although i think even wxWidgets always links some libraries shared always. Sofar i seem to be unable to set a flag to only use static or dynamic libsa to link to :-( Klaas |