Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt-interest Archive, June 2007
Wrong path separators in auto-generated Makefile


Message 1 in thread

Hi,

I have just upgraded to Qt 4.3.0 Open Source Edition for Windows, but
there seems to be an incorrect line in Makefile.Release|Debug
generated by qmake that causes a compile error. Here is the line:

C:/Qt/4.3.0/bin/moc.exe $(DEFINES) $(INCPATH) -D__GNUC__ -DWIN32
window.h -o tmp\moc\release_shared\moc_window.cpp

Path (to moc.exe) separators should be backslashes instead of slashes.
As for other tools like uic, correct paths are generated (I didn't
check all the tools though).

Is this a bug or am I doing something wrong ?

Thanks for advance.
Osawa

--
 [ signature omitted ] 

Message 2 in thread

Hi,

> I have just upgraded to Qt 4.3.0 Open Source Edition for Windows, but
> there seems to be an incorrect line in Makefile.Release|Debug
> generated by qmake that causes a compile error. Here is the line:

What is the compiler error?

> C:/Qt/4.3.0/bin/moc.exe $(DEFINES) $(INCPATH) -D__GNUC__ -DWIN32
> window.h -o tmp\moc\release_shared\moc_window.cpp
> 
> Path (to moc.exe) separators should be backslashes instead of slashes.
> As for other tools like uic, correct paths are generated (I didn't
> check all the tools though).
> 
> Is this a bug or am I doing something wrong ?

I think backslashes have been changed to slashes almost everywhere in Qt 4.3.0 
to support builds under MSYS. This should work both with teh regular Windows 
shell and MSYS.

--
 [ signature omitted ] 

Message 3 in thread

On 06-02-2007 12:04 PM, "Dimitri" wrote:

> I think backslashes have been changed to slashes almost everywhere in Qt 4.3.0
> to support builds under MSYS. This should work both with teh regular Windows
> shell and MSYS.

MSYS maybe, but certainly not under the regular Windows 'shell' (cmd.exe).
'/' is equivalent to '-' on the command line, and does not need a space
before it to be recognized as such. Thus, 'DIR/W' and 'DIR /W' do the same
thing.

>> C:/Qt/4.3.0/bin/moc.exe $(DEFINES) $(INCPATH) -D__GNUC__ -DWIN32
>> window.h -o tmp\moc\release_shared\moc_window.cpp
>> 
>> Path (to moc.exe) separators should be backslashes instead of slashes.
>> As for other tools like uic, correct paths are generated (I didn't
>> check all the tools though).
>> 
>> Is this a bug or am I doing something wrong ?

This appears to be a bug.

Keith


--
 [ signature omitted ] 

Message 4 in thread

> > I think backslashes have been changed to slashes almost everywhere
in Qt
> 4.3.0
> > to support builds under MSYS. This should work both with teh regular
> Windows
> > shell and MSYS.
> 
> MSYS maybe, but certainly not under the regular Windows 'shell'
(cmd.exe).
> '/' is equivalent to '-' on the command line, and does not need a
space
> before it to be recognized as such. Thus, 'DIR/W' and 'DIR /W' do the
same
> thing.
> 
> >> C:/Qt/4.3.0/bin/moc.exe $(DEFINES) $(INCPATH) -D__GNUC__ -DWIN32
> >> window.h -o tmp\moc\release_shared\moc_window.cpp
> >>
> >> Path (to moc.exe) separators should be backslashes instead of
slashes.
> >> As for other tools like uic, correct paths are generated (I didn't
> >> check all the tools though).
> >>
> >> Is this a bug or am I doing something wrong ?
> 
> This appears to be a bug.
> 
> Keith
> 
> 
While I usually avoid cmd.exe like the plague, c:/qt/4.3.0/moc.exe /?
Worked fine for me
C:\documents and settings\scott>c:/qt/4.3.0/bin/moc.exe /?
moc: /?: No such file


Scott

--
 [ signature omitted ] 

Message 5 in thread

> What is the compiler error?

Below are the generated commands and error messages I get when I try
to compile "GroupBox Example". It won't compile unless I fix the path
to moc manually. Before upgraded to 4.3, I used 4.2 and there was no
problem like this. Usually I use command prompt available from Start
Menu -> Qt by Trolltech 4.x.x (OpenSouce).

        g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE
-DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB
-DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN
-I"..\..\include\QtCore" -I"..\..\include\QtCore"
-I"..\..\include\QtGui" -I"..\..\include\QtGui" -I"..\..\include"
-I"." -I"..\..\include\ActiveQt" -I"tmp\moc\release_shared" -I"."
-I"..\..\mkspecs\win32-g++" -o tmp\obj\release_shared\main.o main.cpp
        g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE
-DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB
-DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN
-I"..\..\include\QtCore" -I"..\..\include\QtCore"
-I"..\..\include\QtGui" -I"..\..\include\QtGui" -I"..\..\include"
-I"." -I"..\..\include\ActiveQt" -I"tmp\moc\release_shared" -I"."
-I"..\..\mkspecs\win32-g++" -o tmp\obj\release_shared\window.o
window.cpp
        C:/Qt/4.3.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"..\..\include\QtCore" -I"..\..\include\QtCore"
-I"..\..\include\QtGui" -I"..\..\include\QtGui" -I"..\..\include"
-I"." -I"..\..\include\ActiveQt" -I"tmp\moc\release_shared" -I"."
-I"..\..\mkspecs\win32-g++" -D__GNUC__ -DWIN32 window.h -o
tmp\moc\release_shared\moc_window.cpp
        g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE
-DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB
-DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN
-I"..\..\include\QtCore" -I"..\..\include\QtCore"
-I"..\..\include\QtGui" -I"..\..\include\QtGui" -I"..\..\include"
-I"." -I"..\..\include\ActiveQt" -I"tmp\moc\release_shared" -I"."
-I"..\..\mkspecs\win32-g++" -o tmp\obj\release_shared\moc_window.o
tmp\moc\release_shared\moc_window.cpp
g++.EXE: tmp\moc\release_shared\moc_window.cpp: No such file or directory
g++.EXE: no input files
NMAKE : fatal error U1077: 'C:\MinGW\bin\g++.EXE' : return code '0x1'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio
8\SDK\v2.0\Bin\nmake.exe"' : return code '0x2'
Stop.

--
 [ signature omitted ] 

Message 6 in thread


> -----Original Message-----
> From: Osawa Y. [mailto:putramalu@xxxxxxxxx]
> Sent: Sunday, June 03, 2007 8:59 AM
> To: qt-interest@xxxxxxxxxxxxx
> Subject: Re: Wrong path separators in auto-generated Makefile
> 
> > What is the compiler error?
> 
> Below are the generated commands and error messages I get when I try
> to compile "GroupBox Example". It won't compile unless I fix the path
> to moc manually. Before upgraded to 4.3, I used 4.2 and there was no
> problem like this. Usually I use command prompt available from Start
> Menu -> Qt by Trolltech 4.x.x (OpenSouce).
> 
>         g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE
> -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB
> -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN
> -I"..\..\include\QtCore" -I"..\..\include\QtCore"
> -I"..\..\include\QtGui" -I"..\..\include\QtGui" -I"..\..\include"
> -I"." -I"..\..\include\ActiveQt" -I"tmp\moc\release_shared" -I"."
> -I"..\..\mkspecs\win32-g++" -o tmp\obj\release_shared\main.o main.cpp
>         g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE
> -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB
> -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN
> -I"..\..\include\QtCore" -I"..\..\include\QtCore"
> -I"..\..\include\QtGui" -I"..\..\include\QtGui" -I"..\..\include"
> -I"." -I"..\..\include\ActiveQt" -I"tmp\moc\release_shared" -I"."
> -I"..\..\mkspecs\win32-g++" -o tmp\obj\release_shared\window.o
> window.cpp
>         C:/Qt/4.3.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"..\..\include\QtCore" -I"..\..\include\QtCore"
> -I"..\..\include\QtGui" -I"..\..\include\QtGui" -I"..\..\include"
> -I"." -I"..\..\include\ActiveQt" -I"tmp\moc\release_shared" -I"."
> -I"..\..\mkspecs\win32-g++" -D__GNUC__ -DWIN32 window.h -o
> tmp\moc\release_shared\moc_window.cpp
>         g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE
> -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB
> -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN
> -I"..\..\include\QtCore" -I"..\..\include\QtCore"
> -I"..\..\include\QtGui" -I"..\..\include\QtGui" -I"..\..\include"
> -I"." -I"..\..\include\ActiveQt" -I"tmp\moc\release_shared" -I"."
> -I"..\..\mkspecs\win32-g++" -o tmp\obj\release_shared\moc_window.o
> tmp\moc\release_shared\moc_window.cpp
> g++.EXE: tmp\moc\release_shared\moc_window.cpp: No such file or
directory
> g++.EXE: no input files
> NMAKE : fatal error U1077: 'C:\MinGW\bin\g++.EXE' : return code '0x1'
> Stop.
> NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio
> 8\SDK\v2.0\Bin\nmake.exe"' : return code '0x2'
> Stop.
> 
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
It looks like its getting past the "moc" command correctly, but instead
is an issue with the file being compiled as the result of moc.

Looking at a makefile put out by 4.1.3, the moc command it self, uses
dos slashes for the moc executable, and the compile command of the
resultant file from moc, is also using dos slashes for the output
file...

Test to confirm that the file tmp\moc\release_shared\moc_window.cpp
exists


Scott

--
 [ signature omitted ] 

Message 7 in thread

Hi,

> Test to confirm that the file tmp\moc\release_shared\moc_window.cpp exists.

It turned out that:

1) Currenty (I tested it on Windows XP SP2 but don't know since when)
both "C:\path\to\your.exe" and "C:/path/to/your.exe" work and some
commands accept slash-separated paths too, so "cd ../.." is OK but
"dir C:/Qt/4.3.0" isn't.

2) However, tmp\moc\release_shared\moc_window.cpp is created only when
the moc path is backslash-separated.

Osawa

--
 [ signature omitted ]