Hello

I have the following code snippet to run along with Qt.:

Qt Code:
  1. #include <iostream>
  2. #include <cstdlib> /* for atoi() */
  3.  
  4. int main (int argc, char* argv[]) {
  5. using namespace std;
  6. cout << "argc = " << argc << endl;
  7. for (int i = 0; i < argc; ++i) {
  8. cout << "argv# " << i << " is " << argv[i] << endl;
  9. }
  10. int num = atoi(argv[argc - 1]);
  11. cout << num * 2 << endl;
  12. return 0;
  13. }
To copy to clipboard, switch view to plain text mode 


and then i have the following .pro file :

Qt Code:
  1. ######################################################################
  2. # Automatically generated by qmake (2.01a) Wed Mar 28 08:22:52 2012
  3. ######################################################################
  4.  
  5. TEMPLATE = app
  6. include (../../common.pri)
  7. TARGET =
  8. DEPENDPATH += .
  9. INCLUDEPATH += .
  10.  
  11. # Input
  12. SOURCES += clargs.cpp
To copy to clipboard, switch view to plain text mode 


The common.pri file is pulled out from the Alan Ezust's book code. And while compiling i get the following error:

Qt Code:
  1. sajjad@sajjad:~/Documents/OpenSceneGraph/OpenSceneGraph/osgmultitexturingglsl$ make clean && make
  2. rm -f main.o
  3. rm -f *~ core *.core
  4. g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -I/usr/include/osg -I/usr/include/osgAnimation -I/usr/include/osgDB -I/usr/include/osgGA -I/usr/include/osgManipulator -I/usr/include/osgViewer -I/usr/include/osgUtil -I. -o main.o main.cpp
  5. g++ -Wl,-O1 -o osgmultitexturingglsl main.o -L/usr/lib/i386-linux-gnu -L/usr/lib64 -losgViewer -losgDB -losgUtil -losg -losgSim -lQtGui -lQtCore -lpthread
  6. /usr/bin/ld: cannot find -lQtGui
  7. /usr/bin/ld: cannot find -lQtCore
  8. collect2: ld returned 1 exit status
  9. make: *** [osgmultitexturingglsl] Error 1
To copy to clipboard, switch view to plain text mode 


I can execute other qt related projects and examples fine. Do you see problem in the process ?


Regards
Sajjad