Compiling Qt 4.8.2 results in "ld.exe: final link failed: Memory exhausted"
I'm trying to compile Qt 4.8.2 from sources on Windows 7 x64 with MinGW GCC 4.7.1 (downloaded from http://nuwen.net/mingw.html). The machine has 8GB installed memory. To compile I simply run configure.exe and mingw32-make with all defaults. After a while during the compilation process I get the error "ld.exe: final link failed: Memory exhausted" and the compilation process halts. What could be causing this and how could I fix it? Thanks.
Re: Compiling Qt 4.8.2 results in "ld.exe: final link failed: Memory exhausted"
How much free space do you have on your C:?
Re: Compiling Qt 4.8.2 results in "ld.exe: final link failed: Memory exhausted"
Quote:
Originally Posted by
high_flyer
How much free space do you have on your C:?
50GB. It's an SSD drive.
Re: Compiling Qt 4.8.2 results in "ld.exe: final link failed: Memory exhausted"
Would you care to share the context of the error message? Otherwise we could guess all day which components are involved.
Re: Compiling Qt 4.8.2 results in "ld.exe: final link failed: Memory exhausted"
Quote:
Originally Posted by
ChrisW67
Would you care to share the context of the error message? Otherwise we could guess all day which components are involved.
I'll have to try and compile it again, but it varies I suppose. I've tried compiling it twice and the first time I recall having both QtCore4.dll and QtGui4.dll in the bin directory and the second time I only had QtCore4.dll (IIRC, one of them was missing anyway), in fact the second time there were far fewer DLL files in the bin directory, so it seems to be failing at different points. I'm expecting it to fail at different point on the third try as well. I'll post the full error message when and if it fails again. Just started configure.exe (edit: On a clean installation of course, removed the old directory and extracted the files again)...
I just tried compiling it for the 3rd time. This time I didn't get the "memory exhausted" error though:
Quote:
mingw32-make[1]: Entering directory `C:/Qt/4.8.2/src/script'
mingw32-make -f Makefile.Debug all
mingw32-make[2]: Entering directory `C:/Qt/4.8.2/src/script'
g++ -c -fno-keep-inline-dllexport -Wall -Wreturn-type -fno-strict-aliasing -Wcas
t-align -Wchar-subscripts -Wformat-security -Wreturn-type -Wno-unused-parameter
-Wno-sign-compare -Wno-switch -Wno-switch-enum -Wundef -Wmissing-noreturn -Winit
-self -g -frtti -fexceptions -mthreads -DQT_SHARED -DQT_THREAD_SUPPORT -DUNICODE
-DQT_LARGEFILE_SUPPORT -DJSC=QTJSC -Djscyyparse=qtjscyyparse -Djscyylex=qtjscyy
lex -Djscyyerror=qtjscyyerror -DWTF=QTWTF -DQT_BUILD_SCRIPT_LIB -DQT_NO_USING_NA
MESPACE -DQLALR_NO_QSCRIPTGRAMMAR_DEBUG_INFO -DQT_MAKEDLL -DQT_NO_CAST_TO_ASCII
-DQT_ASCII_CAST_WARNINGS -DQT3_SUPPORT -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -
D_USE_MATH_DEFINES -DBUILDING_QT__=1 -DWTF_USE_ACCELERATED_COMPOSITING -DUSE_SYS
TEM_MALLOC -DBUILDING_QT__ -DBUILDING_JavaScriptCore -DBUILDING_WTF -DWTF_USE_JA
VASCRIPTCORE_BINDINGS=1 -DWTF_CHANGES=1 -DJS_NO_EXPORT -DQT_DLL -DQT_CORE_LIB -D
QT_HAVE_MMX -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -I"..\..\include\QtCor
e" -I"..\..\include" -I"..\3rdparty\javascriptcore\JavaScriptCore" -I"..\3rdpart
y\javascriptcore" -I"..\3rdparty\javascriptcore\JavaScriptCore\assemb ler" -I"..\
3rdparty\javascriptcore\JavaScriptCore\bytecode" -I"..\3rdparty\javascriptcore\J
avaScriptCore\bytecompiler" -I"..\3rdparty\javascriptcore\JavaScriptCore\debugg e
r" -I"..\3rdparty\javascriptcore\JavaScriptCore\interp reter" -I"..\3rdparty\java
scriptcore\JavaScriptCore\jit" -I"..\3rdparty\javascriptcore\JavaScriptCore\par s
er" -I"..\3rdparty\javascriptcore\JavaScriptCore\pcr e" -I"..\3rdparty\javascript
core\JavaScriptCore\profiler" -I"..\3rdparty\javascriptcore\JavaScriptCore\run ti
me" -I"..\3rdparty\javascriptcore\JavaScriptCore\wre c" -I"..\3rdparty\javascript
core\JavaScriptCore\wtf" -I"..\3rdparty\javascriptcore\JavaScriptCore\wtf\sy mbia
n" -I"..\3rdparty\javascriptcore\JavaScriptCore\wtf\un icode" -I"..\3rdparty\java
scriptcore\JavaScriptCore\yarr" -I"..\3rdparty\javascriptcore\JavaScriptCore\API
" -I"..\3rdparty\javascriptcore\JavaScriptCore\Forwar dingHeaders" -I"..\3rdparty
\javascriptcore\JavaScriptCore\generated" -I"..\..\include\QtScript" -I"tmp\rcc\
debug_shared" -I"tmp" -I"c:\Qt\4.8.2\src\3rdparty\javascriptcore\WebKit\q t\Api"
-I"..\3rdparty\javascriptcore\JavaScriptCore\pcr e" -I"c:\Qt\4.8.2\src\3rdparty\j
avascriptcore\JavaScriptCore\tmp" -I"..\3rdparty\javascriptcore\JavaScriptCore"
-I"..\3rdparty\javascriptcore\JavaScriptCore\parser " -I"..\3rdparty\javascriptco
re\JavaScriptCore\bytecompiler" -I"..\3rdparty\javascriptcore\JavaScriptCore\deb
ugger" -I"..\3rdparty\javascriptcore\JavaScriptCore\runtim e" -I"..\3rdparty\java
scriptcore\JavaScriptCore\wtf" -I"c:\Qt\4.8.2\src\script\..\3rdparty\javascript c
ore\JavaScriptCore\unicode" -I"..\3rdparty\javascriptcore\JavaScriptCore\interp r
eter" -I"..\3rdparty\javascriptcore\JavaScriptCore\jit " -I"..\3rdparty\javascrip
tcore\JavaScriptCore\profiler" -I"..\3rdparty\javascriptcore\JavaScriptCore\wre c
" -I"..\3rdparty\javascriptcore\JavaScriptCore\API " -I"..\3rdparty\javascriptcor
e\JavaScriptCore\bytecode" -I"..\3rdparty\javascriptcore\JavaScriptCore\assemb le
r" -I"..\3rdparty\javascriptcore\JavaScriptCore\genera ted" -I"." -I"parser" -I".
.\..\include\ActiveQt" -I"tmp\moc\debug_shared" -I"..\..\mkspecs\win32-g++-4.6"
-o obj\debug\pcre_compile.o ..\3rdparty\javascriptcore\JavaScriptCore\pcre\pcr e_
compile.cpp
..\3rdparty\javascriptcore\JavaScriptCore\pcre\pcr e_compile.cpp: In function 'bo
ol compileBranch(int, int*, unsigned char**, const UChar**, const UChar*, ErrorC
ode*, int*, int*, CompileData&)':
..\3rdparty\javascriptcore\JavaScriptCore\pcre\pcr e_compile.cpp:582:18: warning:
variable 'tempptr' set but not used [-Wunused-but-set-variable]
g++ -c -fno-keep-inline-dllexport -Wall -Wreturn-type -fno-strict-aliasing -Wcas
t-align -Wchar-subscripts -Wformat-security -Wreturn-type -Wno-unused-parameter
-Wno-sign-compare -Wno-switch -Wno-switch-enum -Wundef -Wmissing-noreturn -Winit
-self -g -frtti -fexceptions -mthreads -DQT_SHARED -DQT_THREAD_SUPPORT -DUNICODE
-DQT_LARGEFILE_SUPPORT -DJSC=QTJSC -Djscyyparse=qtjscyyparse -Djscyylex=qtjscyy
lex -Djscyyerror=qtjscyyerror -DWTF=QTWTF -DQT_BUILD_SCRIPT_LIB -DQT_NO_USING_NA
MESPACE -DQLALR_NO_QSCRIPTGRAMMAR_DEBUG_INFO -DQT_MAKEDLL -DQT_NO_CAST_TO_ASCII
-DQT_ASCII_CAST_WARNINGS -DQT3_SUPPORT -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -
D_USE_MATH_DEFINES -DBUILDING_QT__=1 -DWTF_USE_ACCELERATED_COMPOSITING -DUSE_SYS
TEM_MALLOC -DBUILDING_QT__ -DBUILDING_JavaScriptCore -DBUILDING_WTF -DWTF_USE_JA
VASCRIPTCORE_BINDINGS=1 -DWTF_CHANGES=1 -DJS_NO_EXPORT -DQT_DLL -DQT_CORE_LIB -D
QT_HAVE_MMX -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -I"..\..\include\QtCor
e" -I"..\..\include" -I"..\3rdparty\javascriptcore\JavaScriptCore" -I"..\3rdpart
y\javascriptcore" -I"..\3rdparty\javascriptcore\JavaScriptCore\assemb ler" -I"..\
3rdparty\javascriptcore\JavaScriptCore\bytecode" -I"..\3rdparty\javascriptcore\J
avaScriptCore\bytecompiler" -I"..\3rdparty\javascriptcore\JavaScriptCore\debugg e
r" -I"..\3rdparty\javascriptcore\JavaScriptCore\interp reter" -I"..\3rdparty\java
scriptcore\JavaScriptCore\jit" -I"..\3rdparty\javascriptcore\JavaScriptCore\par s
er" -I"..\3rdparty\javascriptcore\JavaScriptCore\pcr e" -I"..\3rdparty\javascript
core\JavaScriptCore\profiler" -I"..\3rdparty\javascriptcore\JavaScriptCore\run ti
me" -I"..\3rdparty\javascriptcore\JavaScriptCore\wre c" -I"..\3rdparty\javascript
core\JavaScriptCore\wtf" -I"..\3rdparty\javascriptcore\JavaScriptCore\wtf\sy mbia
n" -I"..\3rdparty\javascriptcore\JavaScriptCore\wtf\un icode" -I"..\3rdparty\java
scriptcore\JavaScriptCore\yarr" -I"..\3rdparty\javascriptcore\JavaScriptCore\API
" -I"..\3rdparty\javascriptcore\JavaScriptCore\Forwar dingHeaders" -I"..\3rdparty
\javascriptcore\JavaScriptCore\generated" -I"..\..\include\QtScript" -I"tmp\rcc\
debug_shared" -I"tmp" -I"c:\Qt\4.8.2\src\3rdparty\javascriptcore\WebKit\q t\Api"
-I"..\3rdparty\javascriptcore\JavaScriptCore\pcr e" -I"c:\Qt\4.8.2\src\3rdparty\j
avascriptcore\JavaScriptCore\tmp" -I"..\3rdparty\javascriptcore\JavaScriptCore"
-I"..\3rdparty\javascriptcore\JavaScriptCore\parser " -I"..\3rdparty\javascriptco
re\JavaScriptCore\bytecompiler" -I"..\3rdparty\javascriptcore\JavaScriptCore\deb
ugger" -I"..\3rdparty\javascriptcore\JavaScriptCore\runtim e" -I"..\3rdparty\java
scriptcore\JavaScriptCore\wtf" -I"c:\Qt\4.8.2\src\script\..\3rdparty\javascript c
ore\JavaScriptCore\unicode" -I"..\3rdparty\javascriptcore\JavaScriptCore\interp r
eter" -I"..\3rdparty\javascriptcore\JavaScriptCore\jit " -I"..\3rdparty\javascrip
tcore\JavaScriptCore\profiler" -I"..\3rdparty\javascriptcore\JavaScriptCore\wre c
" -I"..\3rdparty\javascriptcore\JavaScriptCore\API " -I"..\3rdparty\javascriptcor
e\JavaScriptCore\bytecode" -I"..\3rdparty\javascriptcore\JavaScriptCore\assemb le
r" -I"..\3rdparty\javascriptcore\JavaScriptCore\genera ted" -I"." -I"parser" -I".
.\..\include\ActiveQt" -I"tmp\moc\debug_shared" -I"..\..\mkspecs\win32-g++-4.6"
-o obj\debug\pcre_exec.o ..\3rdparty\javascriptcore\JavaScriptCore\pcre\pcr e_exe
c.cpp
In file included from ..\3rdparty\javascriptcore\JavaScriptCore/wtf/FastAllocBase.h:84:0,
from ..\3rdparty\javascriptcore\JavaScriptCore/wtf/Vector.h:24,
from ..\3rdparty\javascriptcore\JavaScriptCore\pcre\pcr e_exec.cpp:50:
..\3rdparty\javascriptcore\JavaScriptCore/wtf/TypeTraits.h:173:69: error: 'std::tr1' has not been declared
..\3rdparty\javascriptcore\JavaScriptCore/wtf/TypeTraits.h:173:74: error: expected '{' before 'has_trivial_constructor'
..\3rdparty\javascriptcore\JavaScriptCore/wtf/TypeTraits.h:173:97: error: expected initializer before '<' token
..\3rdparty\javascriptcore\JavaScriptCore/wtf/TypeTraits.h:174:68: error: 'std::tr1' has not been declared
..\3rdparty\javascriptcore\JavaScriptCore/wtf/TypeTraits.h:174:73: error: expected '{' before 'has_trivial_destructor'
..\3rdparty\javascriptcore\JavaScriptCore/wtf/TypeTraits.h:174:95: error: expected initializer before '<' token
mingw32-make[2]: *** [obj/debug/pcre_exec.o] Error 1
mingw32-make[2]: Leaving directory `C:/Qt/4.8.2/src/script'
mingw32-make[1]: *** [debug-all] Error 2
mingw32-make[1]: Leaving directory `C:/Qt/4.8.2/src/script'
mingw32-make: *** [sub-script-make_default-ordered] Error 2
So how could I get past this error message then?
At least I got far enough that I got moc.exe, qmake.exe and all the DLLs I'm gonna need. I just tried compiling a simple project and it worked fine and the executable runs just fine. Am I good to go or should I bother with this error and see the compilation process succeed?
Thanks again.
Re: Compiling Qt 4.8.2 results in "ld.exe: final link failed: Memory exhausted"
With compile errors we can't help you without code, specifically the location noted in the error.
But from the sound of it, it looks like includes are missing.
Re: Compiling Qt 4.8.2 results in "ld.exe: final link failed: Memory exhausted"
Quote:
Originally Posted by
high_flyer
With compile errors we can't help you without code, specifically the location noted in the error.
But from the sound of it, it looks like includes are missing.
I downloaded the code from here: http://qt.nokia.com/downloads/
Direct link: http://releases.qt-project.org/qt4/s...-src-4.8.2.zip
The directory is C:\Qt\4.8.2\src\3rdparty\javascriptcore\JavaScriptCore\wtf
I haven't modified anything or even touched anything. All I did was
1) download the source from above links
2) extract zip to C:\Qt\4.8.2
3) run configure.exe
4) run mingw32-make
How can there be errors like this in the source in the first place? Shouldn't the Qt team supply sources that compile without me having to fix their missing includes and fix whatever else errors in the code?
Anyhow, here's the lines in TypeTraits.h that cause the error:
Code:
#if (defined(__GLIBCXX__) && (__GLIBCXX__ >= 20070724) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || (defined(_MSC_VER) && (_MSC_VER >= 1600))
#include <type_traits>
#endif
// ...
#if (defined(__GLIBCXX__) && (__GLIBCXX__ >= 20070724) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || (defined(_MSC_VER) && (_MSC_VER >= 1600))
// GCC's libstdc++ 20070724 and later supports C++ TR1 type_traits in the std namespace.
// VC10 (VS2010) and later support C++ TR1 type_traits in the std::tr1 namespace.
template<typename T> struct HasTrivialConstructor : public std::tr1::has_trivial_constructor<T> { }; // <-- line 173
template<typename T> struct HasTrivialDestructor : public std::tr1::has_trivial_destructor<T> { }; // <-- line 174
#else
// ...
The other file references in the error message are just #includes that all lead to this file.
Re: Compiling Qt 4.8.2 results in "ld.exe: final link failed: Memory exhausted"
Re: Compiling Qt 4.8.2 results in "ld.exe: final link failed: Memory exhausted"
Quote:
Originally Posted by
high_flyer
Changing #include <type_traits> to #include <tr1/type_traits> indeed did the trick, until I got another error message about "undefined reference to `_Unwind_Resume' and '__gxx_personality_v0'". So I removed the installation and tried compiling again with the tr1/type_traits header change. This time I didn't get the error about the type_traits and I didn't get an error about the _Unwind_Resume, but this time it stopped to another error about ambiguity once again in src\3rdparty\javascriptcore\JavaScriptCore\wtf, in file HashTable.h, on line 272, IIRC, that has this code:
Code:
using std::swap;
#if !COMPILER(MSVC) && !OS(QNX)
// The Dinkumware C++ library (used by MSVC and QNX) has a swap for pairs defined.
// swap pairs by component, in case of pair members that specialize swap
template<typename T, typename U> inline void swap(pair<T, U>& a, pair<T, U>& b)
{
swap(a.first, b.first);
swap(a.second, b.second);
}
#endif
template<typename T, bool useSwap> struct Mover;
template<typename T> struct Mover<T, true> { static void move(T& from, T& to) { swap(from, to); } }; // <-- line 272: error: call to swap is ambiguous
template<typename T> struct Mover<T, false> { static void move(T& from, T& to) { to = from; } };