PDA

View Full Version : compiling hello world after fresh install fails



kvesi
19th September 2008, 11:06
Hi,

I installed Qt to my Win XP machide (qt-win-opensource-4.4.2-mingw.exe). Mingw was installed by the Qt installer.

After installation I enter command prompt by selecting "Qt 4.4.2 command prompt" from the start menu. This sets path and other environment stuff correctly.

Next I go to folder C:\Qt\4.4.2\examples\tutorials\tutorial\t1 and type

qmake -project
qmake
make

make fails. I get the following:


C:\Qt\4.4.2\examples\tutorials\tutorial\t1>make
mingw32-make -f Makefile.Debug all
mingw32-make[1]: Entering directory `C:/Qt/4.4.2/examples/tutorials/tutorial/t1'
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_
THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\..\..\..\include\QtCore" -I"..\..\..\..\include\QtCore" -I"..\..\..\..\include\QtG
ui" -I"..\..\..\..\include\QtGui" -I"..\..\..\..\include" -I"." -I"c:\Qt\4.4.2\include\ActiveQt" -I"tmp\moc\debug_shared
" -I"." -I"..\..\..\..\mkspecs\win32-g++" -o tmp\obj\debug_shared\main.o main.cpp
g++: main.cpp: No such file or directory
g++: no input files
mingw32-make[1]: *** [tmp/obj/debug_shared/main.o] Error 1
mingw32-make[1]: Leaving directory `C:/Qt/4.4.2/examples/tutorials/tutorial/t1'
mingw32-make: *** [debug-all] Error 2

Error is not displayed if I type "g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -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"c:\Qt\4.4.2\include\ActiveQt" -I"tmp\moc\debug_shared" -I"." -I"..\..\..\..\mkspecs\win32-g++" -o tmp\obj\debug_shared\main.o main.cpp" directly to screen.

Any ideas?

kvesi
19th September 2008, 11:51
To me it seems that make is not working on correct folder ("g++: main.cpp: No such file or directory") despite this text is on the screen: "mingw32-make[1]: Entering directory `C:/Qt/4.4.2/examples/tutorials/tutorial/t1'"

main.cpp is in the folder where I type make.

kvesi
19th September 2008, 13:10
My monologue continues :)

nmake works, but mingw32-make does not.

C:\Work\t1>nmake

[...]
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_S
UPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN
-I"..\..\Qt\4.4.2\include\QtCore" -I"..\..\Qt\4.4.2\include\QtCore" -I"..\..\Qt\
4.4.2\include\QtGui" -I"..\..\Qt\4.4.2\include\QtGui" -I"..\..\Qt\4.4.2\include"
-I"." -I"c:\Qt\4.4.2\include\ActiveQt" -I"debug" -I"." -I"..\..\Qt\4.4.2\mkspec
s\win32-g++" -o debug\main.o main.cpp
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-ps
eudo-reloc -mthreads -Wl -Wl,-subsystem,windows -o debug\t1.exe debug/main.o -L
"c:\Qt\4.4.2\lib" -lmingw32 -lqtmaind -lQtGuid4 -lQtCored4

C:\Work\t1>

kvesi
19th September 2008, 13:55
Solved, uh.

I ran make with debug parameter and found out that it creates temporary batch.

"Creating temporary batch file C:\....Temp\make55562.bat"

I had option in the windows registry that always set the folder as c:\work when batch file was run. This cause make file to always work on a wrong directory.

Removing this option from registry solved this case.
(http://windowsxp.mvps.org/autoruncmd.htm)