Results 1 to 9 of 9

Thread: Compiling Qt 4.8.2 results in "ld.exe: final link failed: Memory exhausted"

  1. #1
    Join Date
    Sep 2011
    Posts
    20
    Qt products
    Qt5
    Platforms
    Windows

    Default 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.

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default 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:?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Sep 2011
    Posts
    20
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Compiling Qt 4.8.2 results in "ld.exe: final link failed: Memory exhausted"

    Quote Originally Posted by high_flyer View Post
    How much free space do you have on your C:?
    50GB. It's an SSD drive.

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default 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.

  5. #5
    Join Date
    Sep 2011
    Posts
    20
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Compiling Qt 4.8.2 results in "ld.exe: final link failed: Memory exhausted"

    Quote Originally Posted by ChrisW67 View Post
    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:

    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.
    Last edited by themagician; 26th July 2012 at 09:57.

  6. #6
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default 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.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  7. #7
    Join Date
    Sep 2011
    Posts
    20
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Compiling Qt 4.8.2 results in "ld.exe: final link failed: Memory exhausted"

    Quote Originally Posted by high_flyer View Post
    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:

    Qt Code:
    1. #if (defined(__GLIBCXX__) && (__GLIBCXX__ >= 20070724) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || (defined(_MSC_VER) && (_MSC_VER >= 1600))
    2. #include <type_traits>
    3. #endif
    4.  
    5. // ...
    6.  
    7. #if (defined(__GLIBCXX__) && (__GLIBCXX__ >= 20070724) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || (defined(_MSC_VER) && (_MSC_VER >= 1600))
    8.  
    9. // GCC's libstdc++ 20070724 and later supports C++ TR1 type_traits in the std namespace.
    10. // VC10 (VS2010) and later support C++ TR1 type_traits in the std::tr1 namespace.
    11. template<typename T> struct HasTrivialConstructor : public std::tr1::has_trivial_constructor<T> { }; // <-- line 173
    12. template<typename T> struct HasTrivialDestructor : public std::tr1::has_trivial_destructor<T> { }; // <-- line 174
    13.  
    14. #else
    15. // ...
    To copy to clipboard, switch view to plain text mode 

    The other file references in the error message are just #includes that all lead to this file.

  8. #8
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Compiling Qt 4.8.2 results in "ld.exe: final link failed: Memory exhausted"

    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  9. #9
    Join Date
    Sep 2011
    Posts
    20
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Compiling Qt 4.8.2 results in "ld.exe: final link failed: Memory exhausted"

    Quote Originally Posted by high_flyer View Post
    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:

    Qt Code:
    1. using std::swap;
    2.  
    3. #if !COMPILER(MSVC) && !OS(QNX)
    4. // The Dinkumware C++ library (used by MSVC and QNX) has a swap for pairs defined.
    5.  
    6. // swap pairs by component, in case of pair members that specialize swap
    7. template<typename T, typename U> inline void swap(pair<T, U>& a, pair<T, U>& b)
    8. {
    9. swap(a.first, b.first);
    10. swap(a.second, b.second);
    11. }
    12. #endif
    13.  
    14. template<typename T, bool useSwap> struct Mover;
    15. 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
    16. template<typename T> struct Mover<T, false> { static void move(T& from, T& to) { to = from; } };
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Replies: 7
    Last Post: 8th November 2012, 12:26
  2. "Process failed to start: " and qprocess generic errors
    By scott_hollen in forum Qt Programming
    Replies: 8
    Last Post: 22nd November 2011, 16:03
  3. Replies: 1
    Last Post: 12th October 2010, 15:43
  4. "Treat wchar_t as Built-in Type" to "yes" link error
    By sungaoyong in forum Qt Programming
    Replies: 1
    Last Post: 5th June 2008, 12:45
  5. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 20:05

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.