Hello,
1). Win7 x86, MinGW, wxWidgets2.9.x, Code::Blocks12.11
2) I compiled the Release version of wx2.9.4 by using the following script:
>>mingw32-make -f makefile.gcc CFLAGS=”-Os” CXXFLAGS=”-Os” DEBUG_FLAG=0 BUILD=release
I mean, I used "-Os" option when compiling wxWidgets. And also, I found that the default option for release is "-O2" in makefile.gcc:
ifeq ($(BUILD),release)
__OPTIMIZEFLAG_2 = -O2
endif
When compiling, I found that the script is sth like: g++ **** -O2 -mthread ***** -Os ****. (first -O2, then -Os)
3) Then I tried to create a minimal GUI project(wxWidgets) in CodeBlocks. for Release version, I checked both "-O2" and "-Os".
I found that in file "project.cbp" is sth like this:
<Target title="Release">
<Compiler>
<Add option="-Os" />
<Add option="-O2" />
<Add option="-w" />
<Add option="-DwxDEBUG_LEVEL=0" />
<Add directory="$(#wx)/lib/gcc_lib/mswu" />
</Compiler>
</Target>
when compile this project, the final script is:
mingw32-g++.exe -pipe -mthreads ***** -Os -O2 **** ** (first -Os, then -O2),
then I got many many warnings like:(may be I should not call them warnings, only some strange messages.)
==============================
C:\CodeBlocks\wxWidgets-2.9.5\lib\gcc_lib\libwxbase29u.a(baselib_wxprintf.o): duplicate section `.rdata$_ZTV20wxThreadHelperThread[vtable for wxThreadHelperThread]' has different size
C:\CodeBlocks\wxWidgets-2.9.5\lib\gcc_lib\libwxbase29u.a(baselib_mimetype.o): duplicate section `.rdata$_ZTV20wxThreadHelperThread[vtable for wxThreadHelperThread]' has different size
C:\CodeBlocks\wxWidgets-2.9.5\lib\gcc_lib\libwxbase29u.a(baselib_textfile.o): duplicate section `.rdata$_ZTV20wxThreadHelperThread[vtable for wxThreadHelperThread]' has different size
...........
0 errors, 0 warnings (0 minutes, 13 seconds)
==========================================
4) I found that If I change the order(first -O2 then -Os, the same order as compiling wxWidgets) in the final script, everything will be ok.
anyboby can say sth about this issue? For now, I just removed the -O2, keeped -Os option for GUI project.
Thank you.
Tao
[attachment deleted by admin]