I have a problem loading an openflight (*.flt) model into Openscenegraph using a simple test app:
#include <osgDB/ReadFile>
#include <iostream>
using namespace std;
int main(int argc, char* argv[])
{
// Setting the message level low so I can read Debug messages
osg::setNotifyLevel(osg::NotifySeverity::DEBUG_FP);
cout << "Opening flt file..." << endl;
osg::ref_ptr<osg::Node> mdl = osgDB::readNodeFile(argv[1]);
if (mdl != NULL) cout << "Opening flt file successful" << endl;
else cout << "Opening flt file failed" << endl;
return 0;
}
This should read the file pyramid.flt
, which is in my executable directory by passing the file as argument to the application. However, OSG does not seem to be able to load the required Openflight plugin to indeed read the file. And thus the program returns NULL when trying to load it.
The strange thing is that the debug messages tell me that the required DLL is being used, see below:
Opening flt file...
itr='C:\dev\CgfGen\build32\3dviewer\Debug'
FindFileInPath() : trying C:\dev\CgfGen\build32\3dviewer\Debug\osgPlugins-3.4.1\osgdb_openflightd.dll ...
FindFileInPath() : USING C:\dev\CgfGen\build32\3dviewer\Debug\osgPlugins-3.4.1\osgdb_openflightd.dll
DynamicLibrary::failed loading "osgPlugins-3.4.1/osgdb_openflightd.dll"
Warning: Could not find plugin to read objects from file "pyramid.flt".
Opening flt file failed
I the pyramid.flt is in Openflight version 16.5.
I am running the debug version of my app.
OSG is loading the debug version of osgdb_openflightd.dll
Does anyone have any idea on what the problem is? and how it can be solved?