eclipse 깔고, MinGW 깔고, wxWidget 깔고, C:\wxWidget-x.x.x\build\msw 디렉토리에 가서,
eclipse 에서 File -> New -> C++ Project 를 해서 일반적인 Executable 을 만든다.
프로젝트에 대고 오른쪽 버튼 -> New -> Source File 로 main.cpp 를 만든다.
프로젝트에 대고 오른쪽 버튼 -> Properties 를 선택. C/C++ Build -> Settings -> Tool settings 탭을 선택한다.
1. GCC C++ Compiler -> Preprocessor 의 Defines symbols 에
* 앞에서 라이브러리 컴파일을 debug, UNICODE 로 해서 위와 같은 Preprocessor 를 선언한다.
2. GCC C++ Compiler -> Directories 의 Include paths 에
* 여기서 gcc_lib\mswud 는 msw Unicode Debug 용이다.
3. MinGW C++ Linker -> Libraries 의 Libraries 에 다음과 같은 순서로 라이브러리를 하나씩 넣는다. 이상하게 순서가 다를 때 링커 에러가 나는 경우가 있는 듯 하다.
4. MinGW C++ Linker -> Libraries 의 Library search path 에 C:\wxWidgets-x.x.x\lib\gcc_lib 를 넣는다.
5. MinGW C++ Linker -> Miscellaneous 의 Linker flags 에
6. 제대로 빌드 된 컴파일 명령은 다음과 같다.
[출처] http://zelon.springnote.com/pages/3550325
개인 정리
make -f makefile.gcc BUILD=debug UNICODE=1 SHARED=0위와 같이 컴파일을 해서 라이브러리를 컴파일한다. wxWidget 은 debug 인지 아닌지, 유니코드를 쓰는지 안 쓰는지에 따라 라이브러리 파일명이 틀리므로 주의하자.
eclipse 에서 File -> New -> C++ Project 를 해서 일반적인 Executable 을 만든다.
프로젝트에 대고 오른쪽 버튼 -> New -> Source File 로 main.cpp 를 만든다.
프로젝트에 대고 오른쪽 버튼 -> Properties 를 선택. C/C++ Build -> Settings -> Tool settings 탭을 선택한다.
1. GCC C++ Compiler -> Preprocessor 의 Defines symbols 에
__WXMSW__를 입력.
__WXDEBUG__
_UNICODE
* 앞에서 라이브러리 컴파일을 debug, UNICODE 로 해서 위와 같은 Preprocessor 를 선언한다.
2. GCC C++ Compiler -> Directories 의 Include paths 에
C:\wxWidgets-x.x.x\include를 입력한다.
C:\wxWidgets-x.x.x\gcc_lib\mswud
* 여기서 gcc_lib\mswud 는 msw Unicode Debug 용이다.
3. MinGW C++ Linker -> Libraries 의 Libraries 에 다음과 같은 순서로 라이브러리를 하나씩 넣는다. 이상하게 순서가 다를 때 링커 에러가 나는 경우가 있는 듯 하다.
wxmsw28ud_core
wxbase28ud
wxtiffd
wxjpegd
wxpngd
wxzlibd
wxregexd
wxexpatd
kernel32
user32
gdi32
comdlg32
winspool
winmm
shell32
comctl32
ole32
oleaut32
uuid
rpcrt4
advapi32
wsock32
odbc32
4. MinGW C++ Linker -> Libraries 의 Library search path 에 C:\wxWidgets-x.x.x\lib\gcc_lib 를 넣는다.
5. MinGW C++ Linker -> Miscellaneous 의 Linker flags 에
-Wl,--subsystem,windows -mwindows를 입력한다.
6. 제대로 빌드 된 컴파일 명령은 다음과 같다.
g++ -D__WXMSW__ -D_UNICODE -D__WXDEBUG__ -IC:\wxWidgets-2.8.7\include -IC:\wxWidgets-2.8.7\lib\gcc_lib\mswud -O0 -g3 -Wall -c -fmessage-length=0 -omain.o ..\main.cpp
g++ -LC:\wxWidgets-2.8.7\lib\gcc_lib -Wl,--subsystem,windows -mwindows -oTestWX.exe main.o -lwxmsw28ud_core -lwxbase28ud -lwxtiffd -lwxjpegd -lwxpngd -lwxzlibd -lwxregexd -lwxexpatd -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32 -lodbc32
[출처] http://zelon.springnote.com/pages/3550325
개인 정리
1. Eclipse Project Properties
2. C/C++ Build -> Builder Settings tab -> Builder -> Builder type : External builder
&& uncheck User default build command && Builder command : mingw32-make -> Apply
3. C/C++ Build -> Environment -> PATH : add D:\16.2011_dev\compilers\wxWidgets\bin -> Apply
4. C/C++ Build -> Tool Chain Editor -> Current builder : GNU Make Builder -> Apply
5. C/C++ Build -> Tool Settings tab -> GCC C++ Compiler -> Miscellaneous -> Other flags
add A) other option
6. C/C++ Build -> Tool Settings tab -> MinGW C++ Linker -> Miscellaneous -> Linker flags
add A) other option
A) wx-config --prefix=d:\16.2011_dev\compilers\wxWidgets --wxcfg=gcc_lib\mswud --debug=yes --unicode=yes --static=no --cxxflags
-mthreads-DHAVE_W32API_H-D__WXMSW__-D__WXDEBUG__-D_UNICODE-Id:\16.2011_dev\compilers\wxWidgets\lib\gcc_lib\mswud-Id:\16.2011_dev\compilers\wxWidgets\include-Wno-ctor-dtor-privacy-pipe-fmessage-length=0
B) wx-config --prefix=d:\16.2011_dev\compilers\wxWidgets --wxcfg=gcc_lib\mswud --debug=yes --unicode=yes --static=no --libs
-mthreads-Wl,--subsystem,windows -mwindows <-- Windows Command Shell 창이 뜨지 않음-Ld:\16.2011_dev\compilers\wxWidgets\lib\gcc_lib-lwxmsw29ud_html-lwxmsw29ud_adv-lwxmsw29ud_core-lwxbase29ud_xml-lwxbase29ud_net-lwxbase29ud-lwxtiffd-lwxjpegd-lwxpngd-lwxzlibd-lwxregexud-lwxexpatd-lkernel32-luser32-lgdi32-lcomdlg32-lwxregexud-lwinspool-lwinmm-lshell32-lcomctl32-lole32-loleaut32-luuid-lrpcrt4-ladvapi32-lwsock32