2011/10/19 xunxun <[email protected]>

> 于 2011/10/19 22:32, K. Frank 写道:
> > Hello Lists!
> >
> > I get the following error:
> >
> >     ./tmp\obj\debug_shared\moc_qgraphicsanchorlayout.o: file not
> > recognized: Memory exhausted
> >
> > in the build step that links QtGuid4.dll when trying to build Qt
> 4.8.0-rc1
> > with mingw-w64 4.7.0
> >
> > Would anyone have some suggestions about how I might fix this?
> > (Task manager reported over 2 GB of available memory after the failed
> > build process exited.  I don't know how much memory was in use during
> > the build.)
> >
> > Would it be possible to configure the Qt build process slightly
> differently?
> > Would there be some way to run the offending link command manually,
> > maybe tweaking it a little, and then continuing with the build process?
> >
> > I am trying to build Qt 4.8.0-rc1:
> >
> >     qt-everywhere-opensource-src-4.8.0-rc1.zip
> >
> > with the mighty Ruben's std::thread-enabled 4.7.0 mingw-w64 build:
> >
> >     x86_64-w64-mingw32-gcc-4.7.0-stdthread_rubenvb.7z
> >
> > I am running on 64-bit windows 7.
> >
> > I ran the configure step for Qt thus:
> >
> >     configure -opensource -platform win32-g++ -debug-and-release
> >
> > Note, I did have to patch the typo in pthread.h ("tm" -->  "___tmp_tm")
> to
> > get past an earlier build error, as described in an earlier thread on
> this list:
> >
> >     http://sourceforge.net/mailarchive/message.php?msg_id=28124842
> >
> > Here's the background on what I'm trying to accomplish:
> >
> > I want to upgrade various parts of my development environment.  I am
> > hoping to use a "late-model" g++ (hence the 4.7.0) to get as much
> > support for the new c++11 as I can.  I specifically want support for
> > std::thread (hence Ruben's std::thread-enabled build).
> >
> > I decided to give Qt 4.8.0 a try (rather than upgrading, for example, to
> > Qt 4.7.4) for no compelling reason, but I figured why not.
> >
> > I can dial back on either the compiler or the Qt version, or downgrade to
> > 32 bits from 64 bits, for that matter, to fix the problem, but my general
> > goal in the upgrade is to push forward as much as possible,
> >
> > A little more detail:
> >
> > The specific link command (from running mingw32-make) that fails is:
> >
> >     g++ -mthreads -shared
> > -Wl,--out-implib,c:\qt\4.8.0-rc1\lib\libQtGuid4.a -o
> > ..\..\lib\QtGuid4.dll object_script.QtGuid.Debug
> > -L"c:\qt\4.8.0-rc1\lib" -L"c:\qt\4.8.0-rc1\lib" -lgdi32 -lcomdlg32
> > -loleaut32 -limm32 -lwinmm -lwinspool -lws2_32 -lole32 -l uuid
> > -luser32 -ladvapi32 tmp\obj\debug_shared\QtGuid_resource_res.o
> > -lmsimg32 -lshell32 -lQtCored4
> >
> > The resulting error message is:
> >
> >     ./tmp\obj\debug_shared\moc_qgraphicsanchorlayout.o: file not
> > recognized: Memory exhausted
> >     collect2.exe: error: ld returned 1 exit status
> >     mingw32-make[2]: *** [..\..\lib\QtGuid4.dll] Error 1
>

Strange, I can compile it without a hitch (if you forget about 1.5 hours of
an unusable system sue to excessive paging because 4GB of Ram isn't enough).

I think you might have too little RAM, and certainly your page size will be
too small. This is a very big problem in ld, it just eats memory like
there's no tomorrow :(

If you don't need a debug Qt, just build the release DLLs:
mingw32-make release

It's the debug info that's eating all memory, for some unexplained reason.

Ruben

>
> > For what it's worth (I doubt it matters), this failed link command occurs
> > immediately after the windres command for compiling
> QtGuid_resource_res.o:
> >
> >     windres -i QtGuid_resource.rc -o
> > tmp\obj\debug_shared\QtGuid_resource_res.o --include-dir=. -DQT_SHARED
> > -DQT_THREAD_SUPPORT -DUNICODE -DQT_LARGEFILE_SUPPORT
> > -DQT_BUILD_GUI_LIB -DQT_NO_USING_NAMESPACE -DQT_MAKEDLL
> > -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT3_SUPPORT
> > -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -D_USE_MATH_DEFINES
> > -DQT_NO_DIRECTDRAW -DQT_USE_BUNDLED_LIBPNG -DPNG_NO_ASSEMBLER_CODE
> > -DQT_NO_CUPS -DQT_NO_LPR -DQT_NO_OPENTYPE -DQT_NO_STYLE_MAC
> > -DQT_NO_STYLE_GTK -DQT_NO_STYLE_WINDOWSCE -DQT_NO_STYLE_WINDOWSMOBILE
> > -DQT_NO_STYLE_S60 -DQT_NO_EGL -DQ_INTERNAL_QAPP_SRC
> > -DQT_NO_DIRECTWRITE -DQT_DLL -DQT_CORE_LIB -DQT_HAVE_MMX
> > -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2
> >
> >
> > Thanks for everyone's thoughts and advice.
> >
> >
> > K. Frank
> >
> >
> Try to add -fno-keep-inline-dllexport to your compiler option.
>

This might work, but is mostly to reduce object size I think (if I'm not
mistaken, it was introduced for wxWidgets to reduce DLL size).

Ruben


>
> --
> Best Regards,
> xunxun
>
>
>
> ------------------------------------------------------------------------------
> All the data continuously generated in your IT infrastructure contains a
> definitive record of customers, application performance, security
> threats, fraudulent activity and more. Splunk takes this data and makes
> sense of it. Business sense. IT sense. Common sense.
> http://p.sf.net/sfu/splunk-d2d-oct
> _______________________________________________
> Mingw-w64-public mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
>
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to