Results 1 to 4 of 4

Thread: compiling hello world after fresh install fails

  1. #1
    Join Date
    Sep 2008
    Posts
    4

    Default compiling hello world after fresh install fails

    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?

  2. #2
    Join Date
    Sep 2008
    Posts
    4

    Default Re: compiling hello world after fresh install fails

    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.

  3. #3
    Join Date
    Sep 2008
    Posts
    4

    Default Re: compiling hello world after fresh install fails

    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>

  4. #4
    Join Date
    Sep 2008
    Posts
    4

    Default Re: compiling hello world after fresh install fails

    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)

Similar Threads

  1. Program not compiling on Fresh install of Leopard
    By dvmorris in forum Qt Programming
    Replies: 1
    Last Post: 22nd November 2007, 10:22

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.