visual-studio-2010visual-c++openscenegraph

OSG plugin not found?


OSG reports that it could not find a plugin like the text plugin or a jpeg plugin. I have already built OSG from source and built even the third party dependencies. Why am I getting this error?


Solution

  • The right way to get rid of this error is to open the OpenSceneGraph.sln file and in Solution Explorer, search for a project called "INSTALL". Right-click on it and build it. Doing this, will allow OSG to automatically find the plugins folder and the DLL's inside it.

    In case your error is happening because it can't find the DLL's located in the bin folder of osg build, you just have to go to your project properties > configuration settings > debug > working directory and set it to the osg_build\bin folder.

    Of course, when you're porting your application to a system which does not have OSG installed, you'll have to move the necessary DLL's to your project's folder and reset the working directory to the place where you kept your new DLL's.

    A quicker way to get rid of this error (for the impatient), you've just got to copy the necessary DLL's (or all DLL's, just to be sure) from the osg build > bin folder and the osg build > bin > plugins folder and paste them in the folder that contains your example program's exe (or ocx).

    This error can also happen when osg can't find a path to a jpeg or png file which you intend to use. Just show it the path by setting the OSG_FILE_PATH environment variable. This is a standard osg env variable, and you won't have to mention it in your project settings. Just create it, and osg will automatically detect the path you set for this env variable.

    Many times OSG does not work because you haven't specified the necessary lib files in Linker > Input > Additional Dependencies. Make sure you check for that. All the best...