2012년 5월 19일 토요일

wxWidget 빌드 에러 ( wxMSW-2.8.12 )

































wxWidgets ("wxMSW-2.8.12")  를 MinGW 로 빌드하다가 "Memory exhausted" 에러가 났다.





이 오류는 다음과 같이 CFLAGS, CXXFLAGS 를 추가하면 해결된다.

MinGW, TDM-GCC 둘다 이 방법으로 wxWidgets 을 빌드할 수 있다.




D:\DEV\wxMSW-2.8.12\build\msw>


mingw32-make.exe -f makefile.gcc CFLAGS=-fno-keep-inline-dllexport CXXFLAGS=-fno-keep-inline-dllexport SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1 clean


mingw32-make.exe -f makefile.gcc CFLAGS=-fno-keep-inline-dllexport CXXFLAGS=-fno-keep-inline-dllexport SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1




mingw32-make.exe -f makefile.gcc CFLAGS=-fno-keep-inline-dllexport CXXFLAGS=-fno-keep-inline-dllexport SHARED=1 MONOLITHIC=1 BUILD=debug UNICODE=1 clean


mingw32-make.exe -f makefile.gcc CFLAGS=-fno-keep-inline-dllexport CXXFLAGS=-fno-keep-inline-dllexport SHARED=1 MONOLITHIC=1 BUILD=debug UNICODE=1







참조:
1. http://wiki.wxwidgets.org/Compiling_wxWidgets_with_MinGW
2. TDM-GCC ( http://tdm-gcc.tdragon.net/ )



(from README-gcc-tdm.txt)


>>>>> USAGE NOTES

*** Inline member functions and DLLs ***

[[[ IMPORTANT NOTE:
[[[ You will probably need to use "-fno-keep-inline-dllexport" when building
[[[ large DLLs with lots of inline member functions, such as the "wxWidgets"
[[[ library's monolithic DLL.

The GCC 4.5 series introduced a change in the way inline functions that are
members of classes are handled in DLLs. Before the 4.5 series, inline member
functions were *not* emitted in DLLs by default; in the 4.5 series and later,
they are.

Unfortunately, this change in behavior led to link-time problems with large
libraries (such as wxWidgets) that use precompiled headers and many inline
member functions, where the linker would run out of memory while trying to
generate the DLL.

In the GCC 4.6 series, therefore, the flag "-fno-keep-inline-dllexport" was
introduced, which allows you to disable the emission of inline functions in DLLs
and return to the old behavior.








댓글 없음: