系统环境
Magic Linux 2.0
python 2.5(有一个 ml 自带的 python 2.4,但默认 python 是 python 2.5, i.e. 输入 python 进入的是python 2.5)
我的安装过程
1. 从 wxpython.org 下载源码包 wxPython-src-2.8.4.2.tar.bz2
2. 把它解压缩到 /my/wxPython
---- 以下操作均在 root 下进行 ----
3. [root@vi /]# cd /my/wxPython-src-2.8.4.2
[root@vi wxPython-src-2.8.4.2]# ./configure --enable-unicode
......
What level of wxWidgets compatibility should be enabled?
wxWidgets 2.4 no
wxWidgets 2.6 yes
Which libraries should wxWidgets use?
jpeg sys
png sys
regex builtin
tiff sys
zlib sys
odbc no
expat sys
libmspack no
sdl no
[root@vi wxPython-src-2.8.4.2]# make
......
(一切正常,没有报错,连 warning 也没有)
[root@vi wxPython-src-2.8.4.2]# make install
....
(还是一切正常)
The installation of wxWidgets is finished. On certain
platforms (e.g. Linux) you'll now have to run ldconfig
if you installed a shared library and also modify the
LD_LIBRARY_PATH (or equivalent) environment variable.
....
[root@vi wxPython-src-2.8.4.2]# ldconfig
[root@vi wxPython-src-2.8.4.2]# LD_LIBRARY_PATH=/usr/local/lib/wx/
(不知道这一行对不对)
[root@vi wxPython-src-2.8.4.2]# cd wxPython
[root@vi wxPython]# ./setup.py install
WARNING: WXWIN not set in environment. Assuming '..'
Found wx-config: /usr/local/bin/wx-config
Using flags: --toolkit=gtk2 --unicode=yes --version=2.8
Preparing CORE...
Preparing GLCANVAS...
Preparing STC...
Preparing GIZMOS...
running install
running build
running build_py
creating build-gtk2.unicode
creating build-gtk2.unicode/lib.linux-i686-2.5
creating build-gtk2.unicode/lib.linux-i686-2.5/wxPython
copying wxPython/webkit.py -> build-gtk2.unicode/lib.linux-i686-2.5/wxPython
......(后面都是 copy 文件等等了)
(突然在这里冒出一个 warning 来,貌似和原型声明有关)
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -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_LARGEFILE_SOURCE=1 -D__WXGTK__ -DXTHREADS -D_REENTRANT -DXUSE_MTSAFE_API -Iinclude -Isrc -I/usr/local/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/local/include/wx-2.8 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/X11R6/include -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/freetype2/config -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/local/include/python2.5 -c src/helpers.cpp -o build-gtk2.unicode/temp.linux-i686-2.5/src/helpers.o -pthread -O3
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
(于是后面反复出现了这个 warning,还有其他的,例如:src/gtk/_misc_wrap.cpp:25396: warning: `GetWeek' is deprecated (declared at /usr/local/include/wx-2.8/wx/datetime.h:727,差不多就是这两种类型的 warning 了)
(到最后,编译到某一个文件的时候失败了)
(完整的出错输出在附件里面)
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
contrib/glcanvas/gtk/glcanvas_wrap.cpp: In function `PyObject* _wrap_new_GLContext(PyObject*, PyObject*, PyObject*)':
contrib/glcanvas/gtk/glcanvas_wrap.cpp:2739: error: `wxGLCanvas' undeclared (first use this function)
contrib/glcanvas/gtk/glcanvas_wrap.cpp:2739: error: (Each undeclared identifier is reported only once for each function it appears in.)
contrib/glcanvas/gtk/glcanvas_wrap.cpp:2739: error: `arg1' undeclared (first use this function)
contrib/glcanvas/gtk/glcanvas_wrap.cpp:2739: error: expected primary-expression before ')' token
contrib/glcanvas/gtk/glcanvas_wrap.cpp:2739: error: expected `;' before numeric constant
contrib/glcanvas/gtk/glcanvas_wrap.cpp:2740: error: `wxGLContext' undeclared (first use this function)
contrib/glcanvas/gtk/glcanvas_wrap.cpp:2740: error: `arg2' undeclared (first use this function)
contrib/glcanvas/gtk/glcanvas_wrap.cpp:2740: error: expected primary-expression before ')' token
contrib/glcanvas/gtk/glcanvas_wrap.cpp:2740: error: expected `;' before ""
......
contrib/glcanvas/gtk/glcanvas_wrap.cpp:4502: error: `WX_GL_RGBA' undeclared (first use this function)
contrib/glcanvas/gtk/glcanvas_wrap.cpp:4503: error: `WX_GL_BUFFER_SIZE' undeclared (first use this function)
contrib/glcanvas/gtk/glcanvas_wrap.cpp:4504: error: `WX_GL_LEVEL' undeclared (first use this function)
contrib/glcanvas/gtk/glcanvas_wrap.cpp:4505: error: `WX_GL_DOUBLEBUFFER' undeclared (first use this function)
contrib/glcanvas/gtk/glcanvas_wrap.cpp:4506: error: `WX_GL_STEREO' undeclared (first use this function)
contrib/glcanvas/gtk/glcanvas_wrap.cpp:4507: error: `WX_GL_AUX_BUFFERS' undeclared (first use this function)
contrib/glcanvas/gtk/glcanvas_wrap.cpp:4508: error: `WX_GL_MIN_RED' undeclared (first use this function)
contrib/glcanvas/gtk/glcanvas_wrap.cpp:4509: error: `WX_GL_MIN_GREEN' undeclared (first use this function)
contrib/glcanvas/gtk/glcanvas_wrap.cpp:4510: error: `WX_GL_MIN_BLUE' undeclared (first use this function)
contrib/glcanvas/gtk/glcanvas_wrap.cpp:4511: error: `WX_GL_MIN_ALPHA' undeclared (first use this function)
contrib/glcanvas/gtk/glcanvas_wrap.cpp:4512: error: `WX_GL_DEPTH_SIZE' undeclared (first use this function)
contrib/glcanvas/gtk/glcanvas_wrap.cpp:4513: error: `WX_GL_STENCIL_SIZE' undeclared (first use this function)
contrib/glcanvas/gtk/glcanvas_wrap.cpp:4514: error: `WX_GL_MIN_ACCUM_RED' undeclared (first use this function)
contrib/glcanvas/gtk/glcanvas_wrap.cpp:4515: error: `WX_GL_MIN_ACCUM_GREEN' undeclared (first use this function)
contrib/glcanvas/gtk/glcanvas_wrap.cpp:4516: error: `WX_GL_MIN_ACCUM_BLUE' undeclared (first use this function)
contrib/glcanvas/gtk/glcanvas_wrap.cpp:4517: error: `WX_GL_MIN_ACCUM_ALPHA' undeclared (first use this function)
error: command 'gcc' failed with exit status 1
(完整的出错输出在附件里面)