0
`#include <osgDB/ReadFile>
#include <osgViewer/Viewer>
int main(int argc, char** argv)
{
    osgViewer::Viewer viewer;
    viewer.setSceneData(osgDB::readNodeFile("cessna.osg"));
    return viewer.run();
}

`

Exception thrown at 0x7618A832 in test.exe: Microsoft C++ exception: std::bad_alloc at memory location 0x004FF994.

Exception thrown at 0x7618A832 in test.exe: Microsoft C++ exception: std::bad_alloc at memory location 0x004FF0B8.

Exception thrown at 0x7618A832 in test.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000.

Unhandled exception at 0x7618A832 in test.exe: Microsoft C++ exception: std::bad_alloc at memory location 0x004FF0B8.

1 Answers1

0

There really isn't enough information to help you in this case. Where is the Exception thrown (i.e. which line)?

Exception thrown at 0x7618A832 in test.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000.

I assume because of this Exception that your readNodeFile doesn't find (and thus doesn't return) the cessna file. Try an absolute path here to make sure the cessna file is found.

Tare
  • 482
  • 1
  • 9
  • 25