Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. Portuguese
  4. [Resolvido]Erro compilando Qt 4.8.3 no Windows 7 e versão do Mingw
Forum Updated to NodeBB v4.3 + New Features

[Resolvido]Erro compilando Qt 4.8.3 no Windows 7 e versão do Mingw

Scheduled Pinned Locked Moved Portuguese
2 Posts 1 Posters 3.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Rodolfo Machado
    wrote on last edited by
    #1

    Amigos, ao compilar a Qt 4.8.3 no Windows 7 ocorreu o seguinte erro, após aproximadamente uma hora e meia de compilação:

    c:/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../../mingw32/bin/ld.exe: out of memory allocating 133569752 bytes
    collect2.exe: error: ld returned 1 exit status
    Makefile.Debug:1015: recipe for target '....\lib\QtGuid4.dll' failed
    mingw32-make[2]: *** [....\lib\QtGuid4.dll] Error 1
    mingw32-make[2]: Leaving directory 'C:/Qt/4.8.3/src/gui'
    Makefile:40: recipe for target 'debug-all' failed
    mingw32-make[1]: *** [debug-all] Error 2
    mingw32-make[1]: Leaving directory 'C:/Qt/4.8.3/src/gui'
    Makefile:426: recipe for target 'sub-gui-make_default-ordered' failed
    mingw32-make: *** [sub-gui-make_default-ordered] Error 2

    Meu computador é um AMD Phenon II x4 (Quadricore), com 8 gigabytes de ram, apesar de que o Windows só reconhece 4.

    Usei os seguinte parâmetros no configure:
    configure -platform win32-g++ -debug-and-release -plugin-sql-psql -L C:\PostgreSql\lib -I C:\PostgreSql\include

    Usei a ultima versão do Mingw, no site da Qt Project é recomendado o Mingw 4.4, mas onde eu encontro esta versão, o instalador da Qt não fez o download dele, por isso fui ao site do Mingw e baixei a ultima versão, mas não estou afirmando que o erro na compilação seja devido a versão do Mingw, é apenas outara duvida, se é possível compilar a Qt com a versão mais atual do Mingw.

    1 Reply Last reply
    0
    • R Offline
      R Offline
      Rodolfo Machado
      wrote on last edited by
      #2

      Resolvido

      Encontrei uma solução para um problema relatado semelhante ao meu, aqui neste link:

      http://qt-project.org/forums/viewthread/18329

      Ao aplicar a solução sugerida, consegui compilar a Qt e em seguida compilei meu aplicativos sem problema:

      For gosh sake…answer the OP’s question!
      Add -fno-keep-inline-dllexport to the mkspec file for win32-g++. It should be located somewhere like:
      C:\Qt\4.8.3\mkspecs\win32-g++\qmake.conf
      Look for a variable called QMAKE_CXXFLAGS and add it there.

      A pessoa que sugeriu a solução não da nenhuma explicação do porque do erro, apesar da solução funcionar, aqui neste outro link encontrei algumas explicações:

      http://sourceforge.net/mailarchive/message.php?msg_id=28485608

      ld memory usage: because of the way import libraries are handled, it
      turns out that linking "directly to the DLL" is both much faster and
      uses much less memory. However, it only works if (a) the DLL exports no
      DATA symbols, and (b) the "implib" has no externally added "static"
      members (libcygwin.a and libmsys-1.0.a are the import libs for
      cygwin-1.dll and msys-1.0.dll respectively, and they are both very odd
      because they add additional static .o's to the implib).

      IF you are sure that your dll satisfies these requirements, then you can
      TRY simply copying /bin/foo.dll onto /lib/libfoo.dll.a.

      If you need to do this for "curretly built" dlls in your source tree,
      obviously you'd need to munge up your Makefile.am/Makefile.in to add the
      new 'cp' rules. Libtool, if used, will make things difficult but it can
      be done.
      A outra parte da minha duvida, sobre qual versão do Mingw usar, também foi resolvida, compilou a Qt com a ultima versão disponível do Mingw em seu site.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved