PDA

View Full Version : qmake and mingw trouble



krivenok
15th January 2006, 13:48
Hello All!

I trying to build my first QT application, but the following errors occured:

make -f Makefile.Release
make[1]: Entering directory `/home/FirstApp'
g++ -c -O2 -O2 -frtti -fexceptions -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"D:/Qt/4.1.0/include/QtCore" -I"D:/Qt/4.1.0/include/QtGui" -I"D:/Qt/4.1.0/include" -I"." -I"D:/Qt/4.1.0/include/ActiveQt" -I"release" -I"." -I"D:/Qt/4.1.0/mkspecs/win32-g++" -o release\main.o main.cpp
D:\Qt\4.1.0\bin\moc.exe -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"D:/Qt/4.1.0/include/QtCore" -I"D:/Qt/4.1.0/include/QtGui" -I"D:/Qt/4.1.0/include" -I"." -I"D:/Qt/4.1.0/include/ActiveQt" -I"release" -I"." -I"D:/Qt/4.1.0/mkspecs/win32-g++" -D__GNUC__ -DWIN32 FirstAppMainWindow.h -o release\moc_FirstAppMainWindow.cpp
/bin/sh.exe: D:Qt4.1.0binmoc.exe: command not found
make[1]: *** [release\moc_FirstAppMainWindow.cpp] Error 127
make[1]: Leaving directory `/home/FirstApp'
make: *** [release] Error 2

I use sequence of commands:
qmake -project -win32 && qmake && make

My build system is:
* Current MinGW with gcc-3.4.2
* Current qt-4.1.0 (for minGW)

How can I solve this problem?

kandalf
15th January 2006, 14:38
Hi maybe you can check your path.

/bin/sh.exe: D:Qt4.1.0binmoc.exe: command not found
This is what's raising the error.
It is trying to execute a file named D:Qt4.1.0binmoc.exe and that not exists.
It looks like you're missing the slashes on your env. vars.

Can you show us how your %PATH% or $PATH looks?

krivenok
15th January 2006, 14:50
This is my $PATH

.:/usr/local/bin:/mingw/bin:/bin:/c/Perl/bin/:/c/WINNT/system32:/c/WINNT:/c/WINNT/system32/wbem:/d/Qt/4.1.0/bin:/c/Program:/c/Vim/vim62

QT installed in D:\Qt\4.1.0 (/d/Qt/4.1.0 in mingw)

jacek
15th January 2006, 16:01
This is my $PATH

.:/usr/local/bin:/mingw/bin:/bin:/c/Perl/bin/:/c/WINNT/system32:/c/WINNT:/c/WINNT/system32/wbem:/d/Qt/4.1.0/bin:/c/Program:/c/Vim/vim62

QT installed in D:\Qt\4.1.0 (/d/Qt/4.1.0 in mingw)
Use cmd.exe instead of MSYS and make sure that PATH doesn't point to Cygwin binaries.

chimp
9th February 2006, 12:22
I had the same problem and using cmd.exe does work. However I have just gotten used to the msys environment and would like to keep on using it. Is there any other way around this?

Cesar
9th February 2006, 15:52
Try this way:

$ export QTDIR=/d/Qt/4.1.0
$ qmake -project
$ qmake
$ make

Cesar
10th February 2006, 10:37
Try this way:

$ export QTDIR=/d/Qt/4.1.0
$ qmake -project
$ qmake
$ make
Hmm... This is not quite right! It works this way if you don't use moc in the project.
Some digging in $QTDIR/mkspecs/$QMAKESPEC/qmake.conf gives the solution:

$ export MINGW_IN_SHELL=1
$ export QTDIR=/d/Qt/4.1.0
$ qmake -project
$ qmake
$ make

It work's fine for me!

chimp
11th February 2006, 02:00
Thanks. It works just fine.

lorebett
12th February 2009, 22:58
Hmm... This is not quite right! It works this way if you don't use moc in the project.
Some digging in $QTDIR/mkspecs/$QMAKESPEC/qmake.conf gives the solution:

$ export MINGW_IN_SHELL=1
$ export QTDIR=/d/Qt/4.1.0
$ qmake -project
$ qmake
$ make

It work's fine for me!

The problem with moc is still there though... :(