Results 1 to 2 of 2

Thread: compilation error

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2011
    Posts
    212
    Thanks
    24
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default compilation error

    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

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,372
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: compilation error

    What does the pri file contain?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. compilation error
    By jjbabu in forum Qt Programming
    Replies: 30
    Last Post: 8th April 2009, 10:20
  2. Compilation error wen using VTK in QT4.4
    By richardander in forum Qt Programming
    Replies: 3
    Last Post: 9th February 2009, 22:49
  3. Qt 4 compilation error
    By mansoorulhaq in forum Installation and Deployment
    Replies: 1
    Last Post: 8th October 2007, 07:20

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
  •  
Qt is a trademark of The Qt Company.