I'm trying to use the build-in MinGW that comes with C::B to compile wxWidgets 2.8.12. The process runs for some time and then fails with the following error:
Creating library file: ..\..\lib\gcc_dll\libwxmsw28.a
c:/program files (x86)/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../..
/mingw32/bin/ld.exe: out of memory allocating 160 bytes
collect2.exe: error: ld returned 1 exit status
mingw32-make.exe: *** [..\..\lib\gcc_dll\wxmsw28_gcc_custom.dll] Error 1
The compile command issued was:T:\wxMSW-2.8.12\build\msw>mingw32-make.exe -f makefile.gcc USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=0
That is just duplicating what's also in the config.gcc file as far as the command line options goes.
Looking at the system's memory usage, during that last step, memory usage climbs to about 5.6GB out of the system's 8GB. It's a Win7 64-bit machine. Should I forego the MinGW version that comes with C::B and install a stand alone version and try compiling with that?
Edit: Reread this thread and saw the answer I mentioned was already covered.
This sounds like the wxWidgets link error from long ago.
What was the option to fix this?
I have upgraded my MinGW to a version without this bug.
From my old build batch files I see I used these in the past.
-fno-strict-aliasing
-Wno-unused-local-typedefs
-fno-keep-inline-dllexport
I think this one was the fix "-fno-keep-inline-dllexport".
CXXFLAGS="-fno-keep-inline-dllexport"
From http://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows (http://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows)
If you are using a recent version of MinGW you may find that the object files are too large and that the linker runs out of memory. To fix this problem you need to edit config.gcc so that inline functions are not exported, by modifying the CFLAGS and CXXFLAGS lines to:
CFLAGS ?= -fno-keep-inline-dllexport
CXXFLAGS ?= -fno-keep-inline-dllexport
Tim S.