0

i have succesfully integrated Openscenegraph with Visual Studio 2008. The sample "cessna.osg" given as an example runs fine in VS2008 as a console program. But when i try to run the same code as console in Qt it gives an error. I have built Openscenegraph 3.0 with CMAKE using VS2008 compiler with Qt option on windows7 64 bit. In Qt i am using the version QT 4.7.4 Desktop-MSVC2008 (QtSDK). My Qt .pro file looks like this...

QT       += core
QT       -= gui

TARGET = OSGTEST (name of the console project)
CONFIG   += console
CONFIG   -= app_bundle
TEMPLATE = app
SOURCES += main.cpp

INCLUDEPATH +=C:\OPENSCENEGRAPH\INCLUDE\

LIBS +=C:\OPENSCENEGRAPH\LIB\
-lOpenThreadsd\
-losgd\
-losgDBd\
-losgUtild\
-losgViewerd\

i am using the same library and include file paths in VS2008 IDE as mentioned above.

the main.cpp file looks like dis...(which is the same as in VS2008 IDE)

#include <osgDB/ReadFile>
#include <osgViewer/Viewer>


int main()
{
    osg::ref_ptr<osg::Node> root = osgDB::readNodeFile("cessna.osg");
    osgViewer::Viewer viewer;
    viewer.setSceneData( root.get() );
    return viewer.run();
}

the error i am getting is ...

error: LNK1104: cannot open file 'C:\OPENSCENEGRAPH\LIB.obj'

Guide me so that i can run the application as console. Or is there any other way i can run Openscenegraph apps on Qt console?

timday
  • 24,582
  • 12
  • 83
  • 135
rotating_image
  • 3,046
  • 4
  • 28
  • 46

1 Answers1

0

The comment is correct, you want:

LIBS +=-LC:\OPENSCENEGRAPH\LIB\ -lOpenThreadsd -losgd ...

The -L tells qmake the following argument is a folder to search for libraries, not a library itself.

timday
  • 24,582
  • 12
  • 83
  • 135