Results 1 to 2 of 2

Thread: building non-qt project with qmake

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

    Default building non-qt project with qmake

    Hi

    I am using the qmake to build project which no connection with qt . I am creating a static library with some common files which will be used by the application very frequently. The static library is created , but i am getting the following linking error while compiling the application that uses the static library.

    Qt Code:
    1. sajjad@sajjad-G74Sx:~/Documents/OpenSceneGraph/practicebook/cookbook$ make clean && make
    2. cd common/ && make -f Makefile clean
    3. make[1]: Entering directory `/home/sajjad/Documents/OpenSceneGraph/practicebook/cookbook/common'
    4. make -f Makefile.Release clean
    5. make[2]: Entering directory `/home/sajjad/Documents/OpenSceneGraph/practicebook/cookbook/common'
    6. rm -f release/CommonFunctions.o
    7. rm -f *~ core *.core
    8. make[2]: Leaving directory `/home/sajjad/Documents/OpenSceneGraph/practicebook/cookbook/common'
    9. make -f Makefile.Debug clean
    10. make[2]: Entering directory `/home/sajjad/Documents/OpenSceneGraph/practicebook/cookbook/common'
    11. rm -f debug/CommonFunctions.o
    12. rm -f *~ core *.core
    13. make[2]: Leaving directory `/home/sajjad/Documents/OpenSceneGraph/practicebook/cookbook/common'
    14. make[1]: Leaving directory `/home/sajjad/Documents/OpenSceneGraph/practicebook/cookbook/common'
    15. cd ObserverPointer/ && make -f Makefile clean
    16. make[1]: Entering directory `/home/sajjad/Documents/OpenSceneGraph/practicebook/cookbook/ObserverPointer'
    17. /usr/bin/qmake -o Makefile ObserverPointer.pro
    18. make[1]: Leaving directory `/home/sajjad/Documents/OpenSceneGraph/practicebook/cookbook/ObserverPointer'
    19. make[1]: Entering directory `/home/sajjad/Documents/OpenSceneGraph/practicebook/cookbook/ObserverPointer'
    20. rm -f main.o
    21. rm -f *~ core *.core
    22. make[1]: Leaving directory `/home/sajjad/Documents/OpenSceneGraph/practicebook/cookbook/ObserverPointer'
    23. cd common/ && make -f Makefile
    24. make[1]: Entering directory `/home/sajjad/Documents/OpenSceneGraph/practicebook/cookbook/common'
    25. make -f Makefile.Release
    26. make[2]: Entering directory `/home/sajjad/Documents/OpenSceneGraph/practicebook/cookbook/common'
    27. g++ -c -pipe -O2 -fPIC -Wall -W -D_REENTRANT -DQT_WEBKIT -DQT_NO_DEBUG -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/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 -IBuild/common/Release -o release/CommonFunctions.o CommonFunctions.cpp
    28. rm -f libcommon.a
    29. ar cqs libcommon.a release/CommonFunctions.o
    30. rm -f lib/libcommon.a
    31. mv -f libcommon.a lib/
    32. make[2]: Leaving directory `/home/sajjad/Documents/OpenSceneGraph/practicebook/cookbook/common'
    33. make[1]: Leaving directory `/home/sajjad/Documents/OpenSceneGraph/practicebook/cookbook/common'
    34. cd ObserverPointer/ && make -f Makefile
    35. make[1]: Entering directory `/home/sajjad/Documents/OpenSceneGraph/practicebook/cookbook/ObserverPointer'
    36. g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_WEBKIT -DQT_NO_DEBUG -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -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/home/sajjad/Downloads/OpenSceneGraph/OpenSceneGraph-Data-3.0.0 -I../common -I. -o main.o main.cpp
    37. main.cpp:27:18: warning: unused parameter ‘node’ [-Wunused-parameter]
    38. main.cpp:27:18: warning: unused parameter ‘nv’ [-Wunused-parameter]
    39. main.cpp:40:5: warning: unused parameter ‘argc’ [-Wunused-parameter]
    40. main.cpp:40:5: warning: unused parameter ‘argv’ [-Wunused-parameter]
    41. g++ -Wl,-O1 -o ObserverPointer main.o -L../common/lib -L/usr/lib/i386-linux-gnu -losgViewer -losgDB -losgUtil -losg -losgSim -lcommon -lQtCore -lpthread
    42. /usr/bin/ld: /usr/local/lib/libosgViewer.so: undefined reference to symbol 'osgUtil::IntersectionVisitor::IntersectionVisitor(osgUtil::Intersector*, osgUtil::IntersectionVisitor::ReadCallback*)'
    43. /usr/bin/ld: note: 'osgUtil::IntersectionVisitor::IntersectionVisitor(osgUtil::Intersector*, osgUtil::IntersectionVisitor::ReadCallback*)' is defined in DSO /usr/local/lib/libosgUtil.so so try adding it to the linker command line
    44. /usr/local/lib/libosgUtil.so: could not read symbols: Invalid operation
    45. collect2: ld returned 1 exit status
    46. make[1]: *** [ObserverPointer] Error 1
    47. make[1]: Leaving directory `/home/sajjad/Documents/OpenSceneGraph/practicebook/cookbook/ObserverPointer'
    48. make: *** [sub-ObserverPointer-make_default-ordered] Error 2
    To copy to clipboard, switch view to plain text mode 


    Any hints folks ?


    Regards
    Sajjad

  2. #2
    Join Date
    Sep 2011
    Posts
    1,245
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: building non-qt project with qmake

    Hints? Sure, try asking in the correct forum
    http://www.qtcentre.org/forums/3-Qt-Tools


    Also try reading your linker error.
    /usr/bin/ld: /usr/local/lib/libosgViewer.so: undefined reference to symbol 'osgUtil::IntersectionVisitor::IntersectionVisitor(osgUtil::Intersector*, osgUtil::IntersectionVisitor::ReadCallback*)'

    /usr/bin/ld: note: 'osgUtil::IntersectionVisitor::IntersectionVisitor(osgUtil::Intersector*, osgUtil::IntersectionVisitor::ReadCallback*)' is defined in DSO /usr/local/lib/libosgUtil.so so try adding it to the linker command line
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

Similar Threads

  1. Project Building
    By .:saeed:. in forum Newbie
    Replies: 0
    Last Post: 3rd February 2011, 09:04
  2. Replies: 1
    Last Post: 3rd December 2009, 23:34
  3. building only qmake?
    By akos.maroy in forum Qt Tools
    Replies: 4
    Last Post: 27th November 2009, 00:58
  4. Building documentation with qmake
    By nurtsi in forum Installation and Deployment
    Replies: 3
    Last Post: 27th April 2008, 20:58
  5. Building a library with qmake
    By wallyqt in forum Qt Programming
    Replies: 3
    Last Post: 22nd November 2007, 14:17

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.