PDA

View Full Version : compilation error



sajis997
28th March 2012, 07:59
Hello

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



#include <iostream>
#include <cstdlib> /* for atoi() */

int main (int argc, char* argv[]) {
using namespace std;
cout << "argc = " << argc << endl;
for (int i = 0; i < argc; ++i) {
cout << "argv# " << i << " is " << argv[i] << endl;
}
int num = atoi(argv[argc - 1]);
cout << num * 2 << endl;
return 0;
}



and then i have the following .pro file :



################################################## ####################
# Automatically generated by qmake (2.01a) Wed Mar 28 08:22:52 2012
################################################## ####################

TEMPLATE = app
include (../../common.pri)
TARGET =
DEPENDPATH += .
INCLUDEPATH += .

# Input
SOURCES += clargs.cpp




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



sajjad@sajjad:~/Documents/OpenSceneGraph/OpenSceneGraph/osgmultitexturingglsl$ make clean && make
rm -f main.o
rm -f *~ core *.core
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
g++ -Wl,-O1 -o osgmultitexturingglsl main.o -L/usr/lib/i386-linux-gnu -L/usr/lib64 -losgViewer -losgDB -losgUtil -losg -losgSim -lQtGui -lQtCore -lpthread
/usr/bin/ld: cannot find -lQtGui
/usr/bin/ld: cannot find -lQtCore
collect2: ld returned 1 exit status
make: *** [osgmultitexturingglsl] Error 1




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


Regards
Sajjad

wysota
28th March 2012, 12:14
What does the pri file contain?