[Solved] Can't compile project with makefile generated by qtmake
-
Hi. I'm trying to compile my project through the command line using the makefile that was generated by qtmake, and when g++ tries to compile the source code it says "no such file or directory", but the sources and project file are in the same folder!
Those are the steps I followed (all project and source files are in T:\QtTest):
T:\QtTest> qmake -project
T:\QtTest> qmake
T:\QtTest> makeAnd the output is:
mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directoryT:/QtTest' g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"c:\Qt\4.8.0\include\QtCore" -I"c:\Qt\4.8.0\include\QtGui" -I"c:\Qt\4.8.0\include" -I"." -I"c:\Qt\4.8.0\include\ActiveQt" -I"debug" -I"c:\Qt\4.8.0\mkspecs\default" -o debug\main.o main.cpp *g++: main.cpp: no such file or directory* g++: no input files mingw32-make[1]: *** [debug/main.o] Error 1 mingw32-make[1]: Leaving directory
T:/QtTest'
mingw32-make: *** [debug] Error 2Why can't g++ find my source file, if all project and source files are together in the same folder?
Thanks! -
Have you installed the gcc-c++ package?
sudo apt-get install g++
-
looks like this thread deals with the same error, hopefully it helps you solve your problem:
http://www.qtforum.org/article/25985/compiling-hello-world-after-fresh-install-fails.html
-
The qmake doc. is also useful for linking problems:
http://doc.qt.nokia.com/4.7-snapshot/qmake-project-files.html
-
Thanks, my problem was being caused by the same reason as described in http://www.qtforum.org/article/25985/compiling-hello-world-after-fresh-install-fails.html. In fact I had an Autorun entry in the Windows registry so that CMD.EXE would startup in a custom working directory.
Removing that custom entry solved the problem.