Linux 与 wxWebConnect 的动态链接错误

发布于 2024-10-05 16:18:54 字数 10623 浏览 0 评论 0原文

我使用并为其开发 wxWebConnect 和 Python 绑定(请参阅 http://github.com/jonmmorgan/wxwebconnect/ 和 http://github.com/jonmmorgan/pywebconnect/)。这些之前已经在 Linux 上构建过。但是,添加对 XRC 处理程序的支持后,Python 程序在加载 .so 文件时崩溃,并显示错误:

undefined symbol: _ZN22wxWebControlXmlHandlerC1Ev

自从进行更改以支持 XRC 以来,该库已在 Mac OS X 和 Windows 上构建并正确运行。

这个问题的原因似乎是类wxWebControlXmlHandler的构造函数(参见https: //github.com/jonmmorgan/wxwebconnect/blob/master/xh_webcontrol.cpp)未包含在构建的共享对象文件中。在 xh_webcontrol.o 上运行 nm 显示该符号位于该目标文件的文本部分中,并且该目标文件是链接到共享目标的目标文件之一。然而,在共享对象文件上运行 nm 显示它是未定义的,这就是导致崩溃的原因。

我无法理解为什么构造函数没有包含在共享对象文件中,因为它显然是必需的(并且我知道构造函数是在 webcontrol.cpp 中调用的)。这有充分的理由吗?我可以或应该做些什么来强制将构造函数包含在共享对象文件中并导出?

用于构建的命令(生成的安装工具):


gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DSWIG_TYPE_TABLE=_wxPython_table -DSWIG_PYTHON_OUTPUT_TUPLE -DWXP_USE_THREAD=1 -UNDEBUG -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -Iinclude -Isrc -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -Icontrib/wc -Icontrib/wc/webconnect -I/usr/include/xulrunner-1.9.2.11 -I/usr/include/python2.6 -c contrib/wc/gtk/wc_wrap.cpp -o build-gtk2.unicode/temp.linux-i686-2.6/contrib/wc/gtk/wc_wrap.o -pthread -O3 -pthread
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DSWIG_TYPE_TABLE=_wxPython_table -DSWIG_PYTHON_OUTPUT_TUPLE -DWXP_USE_THREAD=1 -UNDEBUG -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -Iinclude -Isrc -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -Icontrib/wc -Icontrib/wc/webconnect -I/usr/include/xulrunner-1.9.2.11 -I/usr/include/python2.6 -c contrib/wc/webconnect/dom.cpp -o build-gtk2.unicode/temp.linux-i686-2.6/contrib/wc/webconnect/dom.o -pthread -O3 -pthread
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DSWIG_TYPE_TABLE=_wxPython_table -DSWIG_PYTHON_OUTPUT_TUPLE -DWXP_USE_THREAD=1 -UNDEBUG -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -Iinclude -Isrc -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -Icontrib/wc -Icontrib/wc/webconnect -I/usr/include/xulrunner-1.9.2.11 -I/usr/include/python2.6 -c contrib/wc/webconnect/nsimpl.cpp -o build-gtk2.unicode/temp.linux-i686-2.6/contrib/wc/webconnect/nsimpl.o -pthread -O3 -pthread
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DSWIG_TYPE_TABLE=_wxPython_table -DSWIG_PYTHON_OUTPUT_TUPLE -DWXP_USE_THREAD=1 -UNDEBUG -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -Iinclude -Isrc -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -Icontrib/wc -Icontrib/wc/webconnect -I/usr/include/xulrunner-1.9.2.11 -I/usr/include/python2.6 -c contrib/wc/webconnect/promptservice.cpp -o build-gtk2.unicode/temp.linux-i686-2.6/contrib/wc/webconnect/promptservice.o -pthread -O3 -pthread
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DSWIG_TYPE_TABLE=_wxPython_table -DSWIG_PYTHON_OUTPUT_TUPLE -DWXP_USE_THREAD=1 -UNDEBUG -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -Iinclude -Isrc -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -Icontrib/wc -Icontrib/wc/webconnect -I/usr/include/xulrunner-1.9.2.11 -I/usr/include/python2.6 -c contrib/wc/webconnect/protocolhandler.cpp -o build-gtk2.unicode/temp.linux-i686-2.6/contrib/wc/webconnect/protocolhandler.o -pthread -O3 -pthread
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DSWIG_TYPE_TABLE=_wxPython_table -DSWIG_PYTHON_OUTPUT_TUPLE -DWXP_USE_THREAD=1 -UNDEBUG -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -Iinclude -Isrc -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -Icontrib/wc -Icontrib/wc/webconnect -I/usr/include/xulrunner-1.9.2.11 -I/usr/include/python2.6 -c contrib/wc/webconnect/webcontrol.cpp -o build-gtk2.unicode/temp.linux-i686-2.6/contrib/wc/webconnect/webcontrol.o -pthread -O3 -pthread
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DSWIG_TYPE_TABLE=_wxPython_table -DSWIG_PYTHON_OUTPUT_TUPLE -DWXP_USE_THREAD=1 -UNDEBUG -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -Iinclude -Isrc -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -Icontrib/wc -Icontrib/wc/webconnect -I/usr/include/xulrunner-1.9.2.11 -I/usr/include/python2.6 -c contrib/wc/webconnect/webframe.cpp -o build-gtk2.unicode/temp.linux-i686-2.6/contrib/wc/webconnect/webframe.o -pthread -O3 -pthread
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DSWIG_TYPE_TABLE=_wxPython_table -DSWIG_PYTHON_OUTPUT_TUPLE -DWXP_USE_THREAD=1 -UNDEBUG -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -Iinclude -Isrc -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -Icontrib/wc -Icontrib/wc/webconnect -I/usr/include/xulrunner-1.9.2.11 -I/usr/include/python2.6 -c contrib/wc/webconnect/webprefs.cpp -o build-gtk2.unicode/temp.linux-i686-2.6/contrib/wc/webconnect/webprefs.o -pthread -O3 -pthread
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DSWIG_TYPE_TABLE=_wxPython_table -DSWIG_PYTHON_OUTPUT_TUPLE -DWXP_USE_THREAD=1 -UNDEBUG -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -Iinclude -Isrc -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -Icontrib/wc -Icontrib/wc/webconnect -I/usr/include/xulrunner-1.9.2.11 -I/usr/include/python2.6 -c contrib/wc/webconnect/xh_webcontrol.cpp -o build-gtk2.unicode/temp.linux-i686-2.6/contrib/wc/webconnect/xh_webcontrol.o -pthread -O3 -pthread
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DSWIG_TYPE_TABLE=_wxPython_table -DSWIG_PYTHON_OUTPUT_TUPLE -DWXP_USE_THREAD=1 -UNDEBUG -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -Iinclude -Isrc -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -Icontrib/wc -Icontrib/wc/webconnect -I/usr/include/xulrunner-1.9.2.11 -I/usr/include/python2.6 -c contrib/wc/pyprotocolhandler.cpp -o build-gtk2.unicode/temp.linux-i686-2.6/contrib/wc/pyprotocolhandler.o -pthread -O3 -pthread
g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions build-gtk2.unicode/temp.linux-i686-2.6/contrib/wc/gtk/wc_wrap.o build-gtk2.unicode/temp.linux-i686-2.6/contrib/wc/webconnect/dom.o build-gtk2.unicode/temp.linux-i686-2.6/contrib/wc/webconnect/nsimpl.o build-gtk2.unicode/temp.linux-i686-2.6/contrib/wc/webconnect/promptservice.o build-gtk2.unicode/temp.linux-i686-2.6/contrib/wc/webconnect/protocolhandler.o build-gtk2.unicode/temp.linux-i686-2.6/contrib/wc/webconnect/webcontrol.o build-gtk2.unicode/temp.linux-i686-2.6/contrib/wc/webconnect/webframe.o build-gtk2.unicode/temp.linux-i686-2.6/contrib/wc/webconnect/webprefs.o build-gtk2.unicode/temp.linux-i686-2.6/contrib/wc/webconnect/xh_webcontrol.o build-gtk2.unicode/temp.linux-i686-2.6/contrib/wc/pyprotocolhandler.o -L/usr/X11R6/lib -lwx_gtk2u_richtext-2.8 -lwx_gtk2u_aui-2.8 -lwx_gtk2u_xrc-2.8 -lwx_gtk2u_qa-2.8 -lwx_gtk2u_html-2.8 -lwx_gtk2u_adv-2.8 -lwx_gtk2u_core-2.8 -lwx_baseu_xml-2.8 -lwx_baseu_net-2.8 -lwx_baseu-2.8 -lwx_gtk2u_xrc-2.8 -o /home/jmmorgan/wxwebconnect/wxPython-src-2.8.11.0/wxPython/wx/_wc.so -pthread -Wl,-Bsymbolic-functions

I use and develop wxWebConnect and Python bindings for it (see http://github.com/jonmmorgan/wxwebconnect/ and http://github.com/jonmmorgan/pywebconnect/). These have built on Linux before. However, when support for XRC handlers was added Python programs crash when loading the .so file with the error:

undefined symbol: _ZN22wxWebControlXmlHandlerC1Ev

The library has been built and runs correctly on both Mac OS X and Windows since the change was made to support XRC.

The cause of this problem seems to be that the constructor for the class wxWebControlXmlHandler (see https://github.com/jonmmorgan/wxwebconnect/blob/master/xh_webcontrol.cpp) is not being included in the built shared object file. Running nm on xh_webcontrol.o shows that the symbol is in the text section of that object file, and that object file is one of the object files that is linked into the shared object. However, running nm on the shared object file shows that it is undefined, and that is what causes the crash.

I can't understand why the constructor is not being included in the shared object file, since it is obviously required (and I know the constructor is invoked in webcontrol.cpp). Is there a good reason for this? Is there anything I can or should do to force the constructor to be included in the shared object file and exported?

Commands used to build (setuptools generated):


gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DSWIG_TYPE_TABLE=_wxPython_table -DSWIG_PYTHON_OUTPUT_TUPLE -DWXP_USE_THREAD=1 -UNDEBUG -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -Iinclude -Isrc -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -Icontrib/wc -Icontrib/wc/webconnect -I/usr/include/xulrunner-1.9.2.11 -I/usr/include/python2.6 -c contrib/wc/gtk/wc_wrap.cpp -o build-gtk2.unicode/temp.linux-i686-2.6/contrib/wc/gtk/wc_wrap.o -pthread -O3 -pthread
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DSWIG_TYPE_TABLE=_wxPython_table -DSWIG_PYTHON_OUTPUT_TUPLE -DWXP_USE_THREAD=1 -UNDEBUG -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -Iinclude -Isrc -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -Icontrib/wc -Icontrib/wc/webconnect -I/usr/include/xulrunner-1.9.2.11 -I/usr/include/python2.6 -c contrib/wc/webconnect/dom.cpp -o build-gtk2.unicode/temp.linux-i686-2.6/contrib/wc/webconnect/dom.o -pthread -O3 -pthread
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DSWIG_TYPE_TABLE=_wxPython_table -DSWIG_PYTHON_OUTPUT_TUPLE -DWXP_USE_THREAD=1 -UNDEBUG -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -Iinclude -Isrc -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -Icontrib/wc -Icontrib/wc/webconnect -I/usr/include/xulrunner-1.9.2.11 -I/usr/include/python2.6 -c contrib/wc/webconnect/nsimpl.cpp -o build-gtk2.unicode/temp.linux-i686-2.6/contrib/wc/webconnect/nsimpl.o -pthread -O3 -pthread
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DSWIG_TYPE_TABLE=_wxPython_table -DSWIG_PYTHON_OUTPUT_TUPLE -DWXP_USE_THREAD=1 -UNDEBUG -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -Iinclude -Isrc -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -Icontrib/wc -Icontrib/wc/webconnect -I/usr/include/xulrunner-1.9.2.11 -I/usr/include/python2.6 -c contrib/wc/webconnect/promptservice.cpp -o build-gtk2.unicode/temp.linux-i686-2.6/contrib/wc/webconnect/promptservice.o -pthread -O3 -pthread
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DSWIG_TYPE_TABLE=_wxPython_table -DSWIG_PYTHON_OUTPUT_TUPLE -DWXP_USE_THREAD=1 -UNDEBUG -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -Iinclude -Isrc -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -Icontrib/wc -Icontrib/wc/webconnect -I/usr/include/xulrunner-1.9.2.11 -I/usr/include/python2.6 -c contrib/wc/webconnect/protocolhandler.cpp -o build-gtk2.unicode/temp.linux-i686-2.6/contrib/wc/webconnect/protocolhandler.o -pthread -O3 -pthread
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DSWIG_TYPE_TABLE=_wxPython_table -DSWIG_PYTHON_OUTPUT_TUPLE -DWXP_USE_THREAD=1 -UNDEBUG -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -Iinclude -Isrc -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -Icontrib/wc -Icontrib/wc/webconnect -I/usr/include/xulrunner-1.9.2.11 -I/usr/include/python2.6 -c contrib/wc/webconnect/webcontrol.cpp -o build-gtk2.unicode/temp.linux-i686-2.6/contrib/wc/webconnect/webcontrol.o -pthread -O3 -pthread
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DSWIG_TYPE_TABLE=_wxPython_table -DSWIG_PYTHON_OUTPUT_TUPLE -DWXP_USE_THREAD=1 -UNDEBUG -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -Iinclude -Isrc -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -Icontrib/wc -Icontrib/wc/webconnect -I/usr/include/xulrunner-1.9.2.11 -I/usr/include/python2.6 -c contrib/wc/webconnect/webframe.cpp -o build-gtk2.unicode/temp.linux-i686-2.6/contrib/wc/webconnect/webframe.o -pthread -O3 -pthread
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DSWIG_TYPE_TABLE=_wxPython_table -DSWIG_PYTHON_OUTPUT_TUPLE -DWXP_USE_THREAD=1 -UNDEBUG -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -Iinclude -Isrc -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -Icontrib/wc -Icontrib/wc/webconnect -I/usr/include/xulrunner-1.9.2.11 -I/usr/include/python2.6 -c contrib/wc/webconnect/webprefs.cpp -o build-gtk2.unicode/temp.linux-i686-2.6/contrib/wc/webconnect/webprefs.o -pthread -O3 -pthread
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DSWIG_TYPE_TABLE=_wxPython_table -DSWIG_PYTHON_OUTPUT_TUPLE -DWXP_USE_THREAD=1 -UNDEBUG -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -Iinclude -Isrc -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -Icontrib/wc -Icontrib/wc/webconnect -I/usr/include/xulrunner-1.9.2.11 -I/usr/include/python2.6 -c contrib/wc/webconnect/xh_webcontrol.cpp -o build-gtk2.unicode/temp.linux-i686-2.6/contrib/wc/webconnect/xh_webcontrol.o -pthread -O3 -pthread
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DSWIG_TYPE_TABLE=_wxPython_table -DSWIG_PYTHON_OUTPUT_TUPLE -DWXP_USE_THREAD=1 -UNDEBUG -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -Iinclude -Isrc -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -Icontrib/wc -Icontrib/wc/webconnect -I/usr/include/xulrunner-1.9.2.11 -I/usr/include/python2.6 -c contrib/wc/pyprotocolhandler.cpp -o build-gtk2.unicode/temp.linux-i686-2.6/contrib/wc/pyprotocolhandler.o -pthread -O3 -pthread
g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions build-gtk2.unicode/temp.linux-i686-2.6/contrib/wc/gtk/wc_wrap.o build-gtk2.unicode/temp.linux-i686-2.6/contrib/wc/webconnect/dom.o build-gtk2.unicode/temp.linux-i686-2.6/contrib/wc/webconnect/nsimpl.o build-gtk2.unicode/temp.linux-i686-2.6/contrib/wc/webconnect/promptservice.o build-gtk2.unicode/temp.linux-i686-2.6/contrib/wc/webconnect/protocolhandler.o build-gtk2.unicode/temp.linux-i686-2.6/contrib/wc/webconnect/webcontrol.o build-gtk2.unicode/temp.linux-i686-2.6/contrib/wc/webconnect/webframe.o build-gtk2.unicode/temp.linux-i686-2.6/contrib/wc/webconnect/webprefs.o build-gtk2.unicode/temp.linux-i686-2.6/contrib/wc/webconnect/xh_webcontrol.o build-gtk2.unicode/temp.linux-i686-2.6/contrib/wc/pyprotocolhandler.o -L/usr/X11R6/lib -lwx_gtk2u_richtext-2.8 -lwx_gtk2u_aui-2.8 -lwx_gtk2u_xrc-2.8 -lwx_gtk2u_qa-2.8 -lwx_gtk2u_html-2.8 -lwx_gtk2u_adv-2.8 -lwx_gtk2u_core-2.8 -lwx_baseu_xml-2.8 -lwx_baseu_net-2.8 -lwx_baseu-2.8 -lwx_gtk2u_xrc-2.8 -o /home/jmmorgan/wxwebconnect/wxPython-src-2.8.11.0/wxPython/wx/_wc.so -pthread -Wl,-Bsymbolic-functions

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

你丑哭了我 2024-10-12 16:18:54

尝试将目标文件放入 -Wl,--whole-archive -Wl,--no-whole-archive 部分。

人ld

--整个存档
对于 --whole-archive 选项后命令行中提到的每个存档,将存档中的每个目标文件包含在
链接,而不是在档案中搜索所需的目标文件。这通常用于将存档文件转换为共享文件
库,强制每个对象都包含在生成的共享库中。该选项可以多次使用。

在 gcc 中使用此选项时有两个注意事项:首先,gcc 不知道此选项,因此您必须使用 -Wl,-whole-archive。
其次,不要忘记在档案列表后使用 -Wl,-no-whole-archive,因为 gcc 会将其自己的档案列表添加到您的档案列表中。
链接,您可能不希望此标志也影响那些。

Try putting your object files in -Wl,--whole-archive -Wl,--no-whole-archive section.

man ld:

--whole-archive
For each archive mentioned on the command line after the --whole-archive option, include every object file in the archive in the
link, rather than searching the archive for the required object files. This is normally used to turn an archive file into a shared
library, forcing every object to be included in the resulting shared library. This option may be used more than once.

Two notes when using this option from gcc: First, gcc doesn't know about this option, so you have to use -Wl,-whole-archive.
Second, don't forget to use -Wl,-no-whole-archive after your list of archives, because gcc will add its own list of archives to your
link and you may not want this flag to affect those as well.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文