PDA

View Full Version : qmake and msys [win]



jh
16th June 2006, 09:04
hi,

since i'm tired to build makefiles by myself i tried using qmake.
my first step was writing a simple test program. i suppose qmake was
designed to use it with the windows console (which is a pain i.t.a).
running make/mingw32-make on msys i got problems with '/' and '\':


make[1]: Entering directory `/c/01. - Arbeit/C++/treewidgettest'
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"C:/Qt/4.1.1/include/QtCore" -I"C:/Qt/4.1.1/include/QtGui"
-I"C:/Qt/4.1.1/include" -I"." -I"C:/Qt/4.1.1/include/ActiveQt" -I"release" -I"." -I"C:/Qt/4.1.1/mkspecs/win32-g++" -o release\main.o main.cpp
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"C:/Qt/4.1.1/include/QtCore" -I"C:/Qt/4.1.1/include/QtGui" -I"C:/Qt/4.1.1/include" -I"." -I"C:/Qt/4.1.1/include/ActiveQt" -I"release" -I"."
-I"C:/Qt/4.1.1/mkspecs/win32-g++" -o release\TreeWidget.o TreeWidget.cpp

C:\Qt\4.1.1\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"C:/Qt/4.1.1/include/QtCore" -I"C:/Qt/4.1.1/include/QtGui"
-I"C:/Qt/4.1.1/include" -I"." -I"C:/Qt/4.1.1/include/ActiveQt" -I"release" -I"."
-I"C:/Qt/4.1.1/mkspecs/win32-g++" -D__GNUC__ -DWIN32 TreeWidget.h -o
release\moc_TreeWidget.cpp

/bin/sh.exe: C:Qt4.1.1binmoc.exe: command not found
make[1]: *** [release\moc_TreeWidget.cpp] Error 127
make[1]: Leaving directory `/c/01. - Arbeit/C++/treewidgettest'
make: *** [release] Error 2

also some commands must be replaced, such as 'del' by 'rm' etc.

how can i use a makefile generated by qmake on a msys console?

best regards,
jh

e8johan
16th June 2006, 09:06
Could the problem be that the path to moc is specified using \ instead of / that msys expects?

fullmetalcoder
16th June 2006, 09:10
1) If you want to keep msys you have to use Unix compatible makefiles. Try appending "-unix" or "-spec linux-g++" when calling qmake but be careful because it could bring some errors as well (I've not tried it...)

2) Use the wi,ndows command line and everything will be Ok. If you're bored with the fact that the output can not be viewed entierely because there are no scrollbars then have a look redir, a tool which is part of mingw-utils (http://www.mingw.org/MinGWiki/index.php/mingw-utils)and can redirect standard output and standard error to files...

jh
16th June 2006, 09:20
Could the problem be that the path to moc is specified using \ instead of / that msys expects?

unfortunately the problem occurs anytime there is a path specified.


make -f Makefile.Release
make[1]: Entering directory `/c/01. - Arbeit/C++/treewidgettest'
g++ -mthreads -Wl,-enable-stdcall-fixup -Wl,-enable-auto-import
-Wl,-enable-runtime-pseudo-reloc -Wl,-s -Wl,-s -Wl,-subsystem,windows -o
"release\treewidgettest.exe" release\main.o release\TreeWidget.o
release\moc_TreeWidget.o -L"C:\Qt\4.1.1\lib" -lmingw32 -lqtmain -lQtGui4 -lQtCore4
g++.exe: releasemoc_TreeWidget.o: No such file or directory
make[1]: *** [release\treewidgettest.exe] Error 1
make[1]: Leaving directory `/c/01. - Arbeit/C++/treewidgettest'
make: *** [release] Error 2


jh

ChristianEhrlicher
16th June 2006, 10:38
qmake does not work with msys - why should it need msys anyway?

jh
16th June 2006, 14:22
not qmake need msys, I NEED IT !!


best regards,
jh

ChristianEhrlicher
16th June 2006, 15:56
Ok, than the other way round - qmake does not support msys

alu
18th June 2006, 07:25
The problems is that you can't have sh.exe in your path:

http://qtnode.net/wiki/MSYS_backslash_problems

lorebett
12th February 2009, 21:55
1) If you want to keep msys you have to use Unix compatible makefiles. Try appending "-unix" or "-spec linux-g++" when calling qmake but be careful because it could bring some errors as well (I've not tried it...)


appending -unix does not solve the problem, since it generates rules like this one:



debug/moc_lcdrange.cpp: lcdrange.h \
c:/Qt/4.4.3/bin/moc.exe
C:\Qt\4.4.3\bin/moc.exe $(DEFINES) $(INCPATH) -D__GNUC__ -DWIN32 lcdrange.h -o debug/moc_lcdrange.cpp


isn't this a bug? Because some path is generated OK for msys (line 2), while the command itself is generated wrong (line 3)

Using -spec linux-g++ raises errors due to include paths not found...