It's Qt but it's Moc'ing me : )

  • Hi,

    I'm trying to compile Qt using the Qt-Everywhere sources I've configured happily but I am struggling with make. It seems that moc is not compiling. As I'm a little green I'm not sure how to fix this. These are the steps I've taken.

    Download and extract the Qt-everywhere Sources from the "Zip file": into @D:\Qt\Sources@

    Download and extract the mingw64 bit "Zip file": into @D:\Qt\Build\mingw64_x64@

    I haven't loaded jom or fart, thought I'd try vanilla first. I am using Strawberry perl, @C:\strawberry\perl\bin@.

    I go into the folder @D:\Qt\Build@ and run

    @set PATH=D:\Qt\Build\mingw64_x64;C:\strawberry\perl\bin;C:\windows\system32@

    Then from the same path I run

    @..\Sources\configure -opensource -confirm-license -opengl desktop -debug-and-release@

    This works fine and says to run mingw32-make. so I execute


    and I get the error that ....\bin\moc.exe failed. Here is the full output :

    cd qtbase\ && ( if not exist Makefile D:\Qt\Build\qtbase\bin\qmake D:\Qt\Source\qtbase\ -o Makefile ) && mingw32-make -f Makefile
    mingw32-make[1]: Entering directory 'D:/Qt/Build/qtbase'
    cd src\ && ( if not exist Makefile D:\Qt\Build\qtbase\bin\qmake D:\Qt\Source\qtbase\src\ -o Makefile ) && mingw32-make -f Makefile
    mingw32-make[2]: Entering directory 'D:/Qt/Build/qtbase/src'
    cd tools\ && ( if not exist Makefile D:\Qt\Build\qtbase\bin\qmake D:\Qt\Source\qtbase\src\tools\ -o Makefile ) && mingw32-make -f Makefile
    mingw32-make[3]: Entering directory 'D:/Qt/Build/qtbase/src/tools'
    cd bootstrap\ && ( if not exist Makefile D:\Qt\Build\qtbase\bin\qmake D:\Qt\Source\qtbase\src\tools\bootstrap\ -o Makefile ) && mingw32-make -f Makefile
    mingw32-make[4]: Entering directory 'D:/Qt/Build/qtbase/src/tools/bootstrap'
    mingw32-make -f Makefile.Release
    mingw32-make[5]: Entering directory 'D:/Qt/Build/qtbase/src/tools/bootstrap'
    mingw32-make[5]: Nothing to be done for 'first'.
    mingw32-make[5]: Leaving directory 'D:/Qt/Build/qtbase/src/tools/bootstrap'
    mingw32-make[4]: Leaving directory 'D:/Qt/Build/qtbase/src/tools/bootstrap'
    cd moc\ && ( if not exist Makefile D:\Qt\Build\qtbase\bin\qmake D:\Qt\Source\qtbase\src\tools\moc\ -o Makefile ) && mingw32-make -f Makefile
    mingw32-make[4]: Entering directory 'D:/Qt/Build/qtbase/src/tools/moc'
    mingw32-make -f Makefile.Release
    mingw32-make[5]: Entering directory 'D:/Qt/Build/qtbase/src/tools/moc'
    g++ -Wl,-s -Wl,-subsystem,console -o ......\bin\moc.exe .obj/release_shared/moc.o .obj/release_shared/preprocessor.o .obj/release_shared/generator.o .obj/release_shared/parser.o .obj/release_shared/token.o .obj/release_shared/main.o -L"C:\Program Files (x86)\Gtk+\lib" -LD:/Qt/Build/qtbase/lib -lQt5Bootstrap -LC:\Program Files (x86)\Gtk+\lib -luser32 -lole32 -ladvapi32 -lz
    Makefile.Release:87: recipe for target '......\bin\moc.exe' failed
    mingw32-make[5]: Leaving directory 'D:/Qt/Build/qtbase/src/tools/moc'
    Makefile:34: recipe for target 'release' failed
    mingw32-make[4]: Leaving directory 'D:/Qt/Build/qtbase/src/tools/moc'
    Makefile:67: recipe for target 'sub-moc-make_first' failed
    mingw32-make[3]: Leaving directory 'D:/Qt/Build/qtbase/src/tools'
    Makefile:51: recipe for target 'sub-tools-make_first' failed
    mingw32-make[2]: Leaving directory 'D:/Qt/Build/qtbase/src'
    Makefile:40: recipe for target 'sub-src-make_first' failed
    mingw32-make[1]: Leaving directory 'D:/Qt/Build/qtbase'
    makefile:52: recipe for target 'module-qtbase-make_first' failed

    Has anyone else had this problem ? Am I perhaps doing something wrong or is there something else I have missed. I'll try with activestate perl a little later but I thought I'd ask as this has happened a few times and google has not been her forthcoming self on this error.

  • I tried with active state Perl and the same error pops up. Will try out Jom and fart in a bit.

  • Moderators

    Are you aware of "this wiki": on compilation for MinGW? I am not sure, if this wiki will help also for Qt5, but it might well do also there. For Qt 4.8.4 and MinGW 64 it worked like a charm.

  • I am aware of it, I followed those instructions when the above error for Moc.exe was generated.

    It doesn't appear to be compiling the moc.exe I've tried with all the switches used in the wiki. Most of them print out the help for configure so I've removed them from configure.cache.

    I've since tried with JOM which reports
    Error dependant 'C:\Program' does not exist
    Though I think it's more something to do with bootstrap as both things seem to fail in that folder. Is there perhaps something I need to include or add in the setup ?

  • Do I have to be on C:\ or is D:\ ok ?

  • Ha, Ha, Progress, I've managed to get past moc.

    As it turns out I installed Gtk+ a while ago and forgot about it. Gtk+ the sneaky little badger setup an INCLUDE and LIB variable in my 'dos' environment which Qt was picking up. Configure was therefore calling the Gtk+ libraries and include paths and those were conflicting with my Qt build. I have now corrected this by adding
    set LIB=
    set INCLUDE=
    to my environmental setup script to clear the include and lib files. This makes my entire environment setup script (environment.cmd) read as follows :
    set PATH=D:\Qt\mingw\bin;D:\Qt\JOM;D:\Qt\Fart;C:\Perl64\bin;C:\Python27_64;C:\Windows\System32;
    set INCLUDE=
    set LIB=
    set LANG=en

    To compile I now run
    cd D:\Qt\Build
    ..\Sources\configure -opensource -confirm-licence -opengl desktop -platform win32-g++ -debug-and-release -no-vcproj
    I switched to active state perl now, though I don't think it matters. I've included python in the path, I have also moved the compile toolchain into D:\Qt\mingw. I've lobed on JOM and FARt but haven't used them yet.

    I am now not sure if I should rather have something else in the LIB or INCLUDE variables ? Compiling again so will be back with an error or a success statement.

    P.s. Thanks Koahnag for your help it's appreciated.

  • Moderators

    Good to know that you finally managed.

    set LIB and set INCLUDE are not set in my installation.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.