I am trying to compile Qt (Windows 7, mingw32-g++ 32-bit under msys) and ld is running out of memory. Does anyone know why? Or perhaps a workaround? Thanks!
$ g++ -mthreads -shared -Wl,--out-implib,i:/Programs/Qt/lib/libQtGuid4.a -o ../ ../lib/QtGuid4.dll object_script.QtGuid.Debug -L'i:/Programs/Qt/lib' -L'i:/Pro grams/Qt/lib' -lgdi32 -lcomdlg32 -loleaut32 -limm32 -lwinmm -lwinspool -lws2_32 -lole32 -luuid -luser32 -ladvapi32 tmp/obj/debug_shared/QtGuid_resource_res.o -lmsimg32 -lshell32 -lQtCored4 -lz i:/programs/mingw/bin/../lib/gcc/mingw32/4.7.0/../../../../mingw32/bin/ld.exe: o ut of memory allocating 133614056 bytes collect2.exe: error: ld returned 1 exit status
Thanks to all the commenters who helped me figure out a solution to this problem. What I did was replace ld
with a large address aware version. I downloaded it from this MinGW build inside the bin folder. The post with the person linking that distribution is here. I hope this helps other people who run into this problem.
If you install the current version of MinGW 4.6 or newer, then compile QT should specify the flag:
configure -platform win32-g++-4.6
In "mkspecs" for win32-g++4.6 already defined flag -fno-keep-inline-dllexport which resolves your problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With