Please do not kick or poke a finger - I am green as brilliant green noob.

I took the distr of debian 6.0.6, installed it on the virtual machine, launched the console. Installed Qt from reps. There is a good lesson about it. But running the make utility to build the first example ends in an error:

root@postgresql /home/test# qmake -project root@postgresql /home/test# qmake root@postgresql /home/test# make g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -o first.o first.cpp g++ -Wl,-O1 -o test first.o -L/usr/lib -lQtGui -lQtCore -lpthread gcc first.o all -o first gcc: all: No such file or directory make: *** [first] Error 1 

Shoveled the tutorial, climbed the Qt site - and did not find the answer - can you help? I am a beginner in Linux ...

  • Did you install the dev packages? - KoVadim 7:42
  • like apt-get install qt-sdk or not enough? - dreadangel

1 answer 1

Reproduced your situation in the box with the same debian. It seems that there is a bug in qmake. When generating a Makefile, it generates in it a rule like: first: all .

That leads to sad consequences if the file name with the source code is first.cpp . Your source file is called this. Take it and rename it to something like test.cpp and correct the .pro file. After that, it should work.

 $ make g++ -c -m64 -pipe -O2 -Wall -W -D_REENTRANT -DQT_WEBKIT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -o test.o test.cpp g++ -m64 -Wl,-O1 -o test test.o -L/usr/lib/x86_64-linux-gnu -lQtGui -lQtCore -lpthread $ ./test Hello world 
  • thanks ... it became even interesting ... by the way, for the sake of interest - does the code in the first example display something on the console? - dreadangel
  • stop ... found - not just "test" but "./test" ... so congratulate me - defloration has passed ...) - dreadangel
  • one
    Just calling your program test not very good in * nix. The point is that there is a command / usr / bin / test, which will be called if you accidentally type test rather than ./test. Then you can scratch your head for a long time ... - avp
  • @avp and if it's not a secret what does this "test" command do? - Rules
  • @Rules read here , kakbe foundations shell scripting;) - thunder