这几天研究了一下如何在Debian Lenny下编译wxWidgets,实现多个库共存。有点入门,写出来与感兴趣的朋友一起研究。
这里编译的是wxGTK 2.8.7版本,解压后,进入解压的目录,建立4个文件夹,分别是:
进入每个相应的目录,分别执行:
4个库都编译完成后,逐个安装,但每安装一个都将/usr/local/bin/wx-config文件拷贝一份到每个版本专用的配置文件,比如/usr/local/bin/wx-config-d,指的是动态Debug版的wx库。以后如果想使用某一个库,可以在makefile或Code::Blocks的编译选项中选择相应的配置文件。
也可以将需要的库的配置文件拷贝到/usr/local/bin/wx-config,再运行sudo ldconfig即可使用。
这里编译的是wxGTK 2.8.7版本,解压后,进入解压的目录,建立4个文件夹,分别是:
build-d 动态Debug版,对应配置文件: wx-config-d
build-r 动态Release版,对应配置文件: wx-config-r
build-ds 静态Debig版,对应配置文件: wx-config-ds
build-rs 静态Release版,对应配置文件: wx-config-rs
build-r 动态Release版,对应配置文件: wx-config-r
build-ds 静态Debig版,对应配置文件: wx-config-ds
build-rs 静态Release版,对应配置文件: wx-config-rs
进入每个相应的目录,分别执行:
../configure --enable-debug --enable-unicode --enable-monolithic --with-opengl && make
../configure --disable-debug --enable-unicode --enable-monolithic --with-opengl && make
../configure --disable-shared --enable-debug --enable-unicode --enable-monolithic --with-opengl && make
../configure --disable-shared --enable-debug --enable-unicode --enable-monolithic --with-opengl && make
../configure --disable-debug --enable-unicode --enable-monolithic --with-opengl && make
../configure --disable-shared --enable-debug --enable-unicode --enable-monolithic --with-opengl && make
../configure --disable-shared --enable-debug --enable-unicode --enable-monolithic --with-opengl && make
4个库都编译完成后,逐个安装,但每安装一个都将/usr/local/bin/wx-config文件拷贝一份到每个版本专用的配置文件,比如/usr/local/bin/wx-config-d,指的是动态Debug版的wx库。以后如果想使用某一个库,可以在makefile或Code::Blocks的编译选项中选择相应的配置文件。
也可以将需要的库的配置文件拷贝到/usr/local/bin/wx-config,再运行sudo ldconfig即可使用。
Joe Smith
2008/06/08 01:50
我以为不需要这么麻烦。wx-config --version=2.8 --static=no --unicode=yes --debug=yes --cflags 加上后面的这些就可以指定具体链接那个库了。您可以到shell下面测试一下。如果有说的不对的地方,可以告诉我。kofshower@gmail.com
qpsoft 回复于 2008/06/12 10:03
如果那样可行的话,或者要修改makefile,或者要修改某些IDE(比如Code::Blocks)的设置,也比较麻烦。我在http://www.qpsoft.com/blog/alias-wxwidgets-lib/里用到了另一方法,效果不错。有时间会尝试一下您给的方法,谢谢提醒!!
分页: 1/1
1
1
编译wxWidgets时别忘了修改setup.h
wxSQLite3编译总结



