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