Error reading file cow.osg: read error (Could not find plugin to read objects from file “cow.osg“.)

problem


#include "osgViewer/Viewer"
#include "osgDB/ReadFile"

int main(int argc, char** argv)
{
	osgViewer::Viewer viewer;
	viewer.setSceneData(osgDB::readNodeFile("cow.osg"));
	return viewer.run();
}

Error reading file cow.osg: read error (Could not find plugin to read objects from file “cow.osg”.)

reason

I compiled the library with osg3.6.5 on one machine, and then wrote the program. It runs normally, but it is copied to the other machine. The other machine is the library compiled with osg3.7.0, so it causes an error

Osg3.6.5 library

osg3.7.0 library

Read More: