Eclipse CDT环境的搭建请参考:基于Eclipse CDT的C/C++开发环境搭建
wxWidgets静态链接方式工程配置
- 创建源码目录:Sources、Headers、Resources,分别用于存放源码、头文件、资源文件
- C/C++ Build - Tool Chain Editor - Current Builder设置为:CDT internal Builder
- C/C++ General - Paths and Symbols配置(GNU C++):头文件包含(Includes):
Debug Release Headers
D:\CPP\tools\boost-1.55.0\include
D:\CPP\tools\wxWidgets-3.0.1\include
D:\CPP\tools\wxWidgets-3.0.1\lib\gcc_lib\mswudHeaders
D:\CPP\tools\boost-1.55.0\include
D:\CPP\tools\wxWidgets-3.0.1\include
D:\CPP\tools\wxWidgets-3.0.1\lib\gcc_lib\mswu宏定义(Symbols):
Debug Release __GNUWIN32__
__WXMSW__
_UNICODE
UNICODE__GNUWIN32__
__WXMSW__
_UNICODE
UNICODE
NDEBUG库(Libraries):
Debug Release wxmsw30ud_stc
wxmsw30ud_propgrid
wxmsw30ud_ribbon
wxmsw30ud_adv
wxmsw30ud_core
wxbase30ud
wxbase30ud_net
wxbase30ud_xml
wxtiffd
wxjpegd
wxpngd
wxzlibd
wxregexud
wxexpatd
kernelB2
user32
gdi32
comdlg32
shell32
comctlB2
ole32
oleaut32
uuid
rpcrt4
advapi32
wsock32wxmsw30u_xrc
wxmsw30u_richtext
wxmsw30u_aui
wxmsw30u_html
wxmsw30u_stc
wxmsw30u_propgrid
wxmsw30u_ribbon
wxmsw30u_adv
wxmsw30u_core
wxbase30u
wx base 30u_ net
wxbase30u_xml
wxjpeg
wxpng
wxzlib
wxexpat
kernel32
user32
comdlg32
shell32
comctlB2
ole32
oleaut32
uuid
rpcrt4
advapi32
wsock32库路径(Library Path):
Debug Release D:\CPP\tools\boost-1.55.0\mingw
D:\CPP\tools\wxWidgets-3.0.1\lib\gcc_libD:\CPP\tools\boost-1.55.0\mingw
D:\CPP\tools\wxWidgets-3.0.1\lib\gcc_lib - C/C++ Build - Settings - Tool Settings - MinGW C++ Linker - Miscellaneous
Link flags -Wl,--subsystem,windows -mwindows Other objects 如果使用资源文件:[Debug|Release]\Sources\resources.o - C/C++ Build - Settings - Build Steps ,如果使用资源文件,设置Pre-build setps 为:
1wxPreBuild.bat 工程名称 [Debug|Release] - 如果使用资源文件,编写预构建脚本,内容如下:
12345678@echo offset ECLIPSE_PROJECTS_PATH=D:\CPP\projects\eclipse\4.3.2set PROJECT_NAME=%1set PROJECT_CFG=%2mkdir %ECLIPSE_PROJECTS_PATH%\%PROJECT_NAME%\%PROJECT_CFG%\Sourcesrem 主要步骤是下面这个:即编译Windows资源文件windres %ECLIPSE_PROJECTS_PATH%/%PROJECT_NAME%/Resources/%PROJECT_NAME%.rc -o %ECLIPSE_PROJECTS_PATH%/%PROJECT_NAME%/%PROJECT_CFG%/Sources/%PROJECT_NAME%.o -I"D:\CPP\tools\wxWidgets-3.0.1\include"
Leave a Reply