[wxWidgets] 使用wx-config编译wxWidget程序

wx-config returns information about the wxWidgets libraries available on your system.
wx-config有许多参数,其中必须要用的两个参数是--libs和--cxxflags。


在我的机器上:

$wx-config --libs
输出结果: -framework IOKit -framework Carbon -framework Cocoa -framework System -framework QuickTime -framework OpenGL -framework AGL -lwx_macud-2.8


$wx-config --cxxflags
输出结果: -I/usr/lib/wx/include/mac-unicode-debug-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXDEBUG__ -D__WXMAC__

编译时使用如下命令即可:

g++ -m32 helloworld.cpp `wx-config --libs --cxxflags` -o helloworld

另外,Window版本的wx-config不是被默认安装的,这个程序不太好找,这里提供了一个。点此下载

posted @ 2011-04-24 03:12  jimbo  阅读(1132)  评论(0编辑  收藏  举报