Something Wrong when i run Sample Browser Topic is solved

Problems building or running the engine, queries about how to use features etc.
Post Reply
newbee19
Gnoblar
Posts: 3
Joined: Wed Feb 13, 2019 3:05 am

Something Wrong when i run Sample Browser

Post by newbee19 » Wed Feb 13, 2019 3:49 am

Ogre Version: :?: ogre-1.11.5
Operating System: :?: Windows 10

I am new to Ogre.And I bulit Orge from the source code by VS2017.I bulid "All BUILD" and "SampBrowser " two projects and success.But I can't run the sampbrowser either in debug mode or release mode. It will occours a expection window says "could not find dynamic library ...(the path)/.\Plugin_CgProgramManager_d." when i run in debug mode.and likely in release mode.

I follow the code and found it crush in the file "OgreApplicationContext.cpp"
in below function:
void ApplicationContext::createRoot()
{
#if (OGRE_THREAD_PROVIDER == 3) && (OGRE_NO_TBB_SCHEDULER == 1)
mTaskScheduler.initialize(OGRE_THREAD_HARDWARE_CONCURRENCY);
#endif

#if OGRE_PLATFORM == OGRE_PLATFORM_ANDROID || OGRE_PLATFORM == OGRE_PLATFORM_EMSCRIPTEN
mRoot = OGRE_NEW Ogre::Root("");
#else
Ogre::String pluginsPath;
# ifndef OGRE_STATIC_LIB
pluginsPath = mFSLayer->getConfigFilePath("plugins.cfg");

if (!Ogre::FileSystemLayer::fileExists(pluginsPath))
{
pluginsPath = Ogre::FileSystemLayer::resolveBundlePath(OGRE_CONFIG_DIR "/plugins" OGRE_BUILD_SUFFIX ".cfg");
}
# endif

:!: mRoot = OGRE_NEW Ogre::Root(pluginsPath, mFSLayer->getWritablePath("ogre.cfg"),
mFSLayer->getWritablePath("ogre.log"));
#endif

#ifdef OGRE_STATIC_LIB
mStaticPluginLoader.load();
#endif
mOverlaySystem = OGRE_NEW Ogre::OverlaySystem();
}

in the statement :!: " mRoot = OGRE_NEW Ogre::Root(pluginsPath, mFSLayer->getWritablePath("ogre.cfg"),
mFSLayer->getWritablePath("ogre.log"));"
I follow my code by key 'F11',after this statement,a exception thorws.


some file i think may help.

my :idea: plugins_d.cfg shows below:
# Defines plugins to load

# Define plugin folder
PluginFolder=.

# Define plugins
Plugin=RenderSystem_Direct3D9_d
Plugin=RenderSystem_Direct3D11_d
Plugin=RenderSystem_GL_d
Plugin=RenderSystem_GL3Plus_d
# Plugin=RenderSystem_GLES2_d
Plugin=Plugin_ParticleFX_d
Plugin=Plugin_BSPSceneManager_d
Plugin=Plugin_CgProgramManager_d
# Plugin=Codec_EXR_d
Plugin=Codec_STBI_d
# Plugin=Codec_FreeImage_d
Plugin=Plugin_PCZSceneManager_d
Plugin=Plugin_OctreeZone_d
Plugin=Plugin_OctreeSceneManager_d



:idea: ogre.log shows below:

10:44:23: Creating resource group General
10:44:23: Creating resource group OgreInternal
10:44:23: Creating resource group OgreAutodetect
10:44:23: SceneManagerFactory for type 'DefaultSceneManager' registered.
10:44:23: Registering ResourceManager for type Material
10:44:23: Registering ResourceManager for type Mesh
10:44:23: Registering ResourceManager for type Skeleton
10:44:23: MovableObjectFactory for type 'ParticleSystem' registered.
10:44:23: ArchiveFactory for archive type FileSystem registered.
10:44:23: ArchiveFactory for archive type Zip registered.
10:44:23: ArchiveFactory for archive type EmbeddedZip registered.
10:44:23: DDS codec registering
10:44:23: ETC codec registering
10:44:23: Registering ResourceManager for type HighLevelGpuProgram
10:44:23: Registering ResourceManager for type Compositor
10:44:23: MovableObjectFactory for type 'Entity' registered.
10:44:23: MovableObjectFactory for type 'Light' registered.
10:44:23: MovableObjectFactory for type 'BillboardSet' registered.
10:44:23: MovableObjectFactory for type 'ManualObject' registered.
10:44:23: MovableObjectFactory for type 'BillboardChain' registered.
10:44:23: MovableObjectFactory for type 'RibbonTrail' registered.
10:44:23: Loading library C:/MyApps/ogre/source/ogre-1.11.5/orge/bin/Debug/.\RenderSystem_Direct3D9_d
10:44:23: Installing plugin: D3D9 RenderSystem
10:44:23: D3D9 : Direct3D9 Rendering Subsystem created.
10:44:23: D3D9: Driver Detection Starts
10:44:23: D3D9: Driver Detection Ends
10:44:23: Plugin successfully installed
10:44:23: Loading library C:/MyApps/ogre/source/ogre-1.11.5/orge/bin/Debug/.\RenderSystem_Direct3D11_d
10:44:23: Installing plugin: D3D11 RenderSystem
10:44:23: D3D11: Direct3D11 Rendering Subsystem created.
10:44:24: D3D11: Driver Detection Starts
10:44:24: D3D11: "Intel(R) HD Graphics 520"
10:44:24: D3D11: "Microsoft Basic Render Driver (software)"
10:44:24: D3D11: Driver Detection Ends
10:44:24: Plugin successfully installed
10:44:24: Loading library C:/MyApps/ogre/source/ogre-1.11.5/orge/bin/Debug/.\RenderSystem_GL_d
10:44:24: Installing plugin: GL RenderSystem
10:44:24: OpenGL Rendering Subsystem created.
10:44:24: Plugin successfully installed
10:44:24: Loading library C:/MyApps/ogre/source/ogre-1.11.5/orge/bin/Debug/.\RenderSystem_GL3Plus_d
10:44:24: Installing plugin: GL 3+ RenderSystem
10:44:24: OpenGL 3+ Rendering Subsystem created.
10:44:24: Plugin successfully installed
10:44:24: Loading library C:/MyApps/ogre/source/ogre-1.11.5/orge/bin/Debug/.\Plugin_ParticleFX_d
10:44:24: Installing plugin: ParticleFX
10:44:24: Particle Emitter Type 'Point' registered
10:44:24: Particle Emitter Type 'Box' registered
10:44:24: Particle Emitter Type 'Ellipsoid' registered
10:44:24: Particle Emitter Type 'Cylinder' registered
10:44:24: Particle Emitter Type 'Ring' registered
10:44:24: Particle Emitter Type 'HollowEllipsoid' registered
10:44:24: Particle Affector Type 'LinearForce' registered
10:44:24: Particle Affector Type 'ColourFader' registered
10:44:24: Particle Affector Type 'ColourFader2' registered
10:44:24: Particle Affector Type 'ColourImage' registered
10:44:24: Particle Affector Type 'ColourInterpolator' registered
10:44:24: Particle Affector Type 'Scaler' registered
10:44:24: Particle Affector Type 'Rotator' registered
10:44:24: Particle Affector Type 'DirectionRandomiser' registered
10:44:24: Particle Affector Type 'DeflectorPlane' registered
10:44:24: Plugin successfully installed
10:44:24: Loading library C:/MyApps/ogre/source/ogre-1.11.5/orge/bin/Debug/.\Plugin_BSPSceneManager_d
10:44:24: Installing plugin: BSP Scene Manager
10:44:24: Plugin successfully installed
10:44:24: Loading library C:/MyApps/ogre/source/ogre-1.11.5/orge/bin/Debug/.\Plugin_CgProgramManager_d
:idea: 10:44:24: Ogre::InternalErrorException::InternalErrorException: Could not load dynamic library C:/MyApps/ogre/source/ogre-1.11.5/orge/bin/Debug/.\Plugin_CgProgramManager_d. System Error: can not find specific module。

in DynLib::load at C:\MyApps\ogre\source\ogre-1.11.5\OgreMain\src\OgreDynLib.cpp (line 112)
10:44:24: Unregistering ResourceManager for type Compositor
10:44:24: Unregistering ResourceManager for type Skeleton
10:44:24: Unregistering ResourceManager for type Mesh
10:44:24: Unregistering ResourceManager for type HighLevelGpuProgram
10:44:24: Unregistering ResourceManager for type Material
10:44:24: Unloading library C:/MyApps/ogre/source/ogre-1.11.5/orge/bin/Debug/.\Plugin_BSPSceneManager_d
10:44:24: Unloading library C:/MyApps/ogre/source/ogre-1.11.5/orge/bin/Debug/.\Plugin_ParticleFX_d
10:44:24: Unloading library C:/MyApps/ogre/source/ogre-1.11.5/orge/bin/Debug/.\RenderSystem_Direct3D11_d
10:44:24: Unloading library C:/MyApps/ogre/source/ogre-1.11.5/orge/bin/Debug/.\RenderSystem_Direct3D9_d
10:44:24: Unloading library C:/MyApps/ogre/source/ogre-1.11.5/orge/bin/Debug/.\RenderSystem_GL3Plus_d
10:44:24: Unloading library C:/MyApps/ogre/source/ogre-1.11.5/orge/bin/Debug/.\RenderSystem_GL_d

I copy both the Plugin_CgProgramManager.dll and Plugin_CgProgramManager_d.dll to the bin/debug and /release folder , but it still occurs.

looking forward for your reply.
best wishes.
0 x

sercero
Gnoblar
Posts: 15
Joined: Sun Jan 18, 2015 4:20 pm
x 1

Re: Something Wrong when i run Sample Browser

Post by sercero » Wed Feb 13, 2019 6:18 pm

Hello,

Next time could you please use the code button for code?

That way the post is much more readable.

Code: Select all

# Define plugin folder
PluginFolder=.
Try to modify the PluginFolder to point to where the DLL files are.

Hope this helps.

Best regards.
1 x

rpgplayerrobin
Greenskin
Posts: 145
Joined: Wed Mar 18, 2009 3:03 am
x 15

Re: Something Wrong when i run Sample Browser

Post by rpgplayerrobin » Wed Feb 13, 2019 6:36 pm

Your error is not because of that DLL.
The error is because of "cg.dll", which is used with that DLL.

I get the exact same error if I remove "cg.dll" from my directory while trying to load the CG plugin DLL.
1 x

newbee19
Gnoblar
Posts: 3
Joined: Wed Feb 13, 2019 3:05 am

Re: Something Wrong when i run Sample Browser

Post by newbee19 » Thu Feb 14, 2019 3:11 am

sercero wrote:
Wed Feb 13, 2019 6:18 pm
Hello,

Next time could you please use the code button for code?

That way the post is much more readable.

Code: Select all

# Define plugin folder
PluginFolder=.
Try to modify the PluginFolder to point to where the DLL files are.

Hope this helps.

Best regards.
Thanks for your advice. I will try to use code button next time.And I rebuild PluginFolder and do not work. Finally , I change my CMake version and config and build again.it just works.I don't understand the reason,but it just works.
0 x

newbee19
Gnoblar
Posts: 3
Joined: Wed Feb 13, 2019 3:05 am

Re: Something Wrong when i run Sample Browser

Post by newbee19 » Thu Feb 14, 2019 3:22 am

rpgplayerrobin wrote:
Wed Feb 13, 2019 6:36 pm
Your error is not because of that DLL.
The error is because of "cg.dll", which is used with that DLL.

I get the exact same error if I remove "cg.dll" from my directory while trying to load the CG plugin DLL.
Thank you very much.It works!!Could you please tell me how you get the missing DLL is "cg.dll"?I tried to use depends to find the missing DLL but got nothing,maybe I didn't take a good use of that.
0 x

User avatar
saintnick
Halfling
Posts: 51
Joined: Tue Nov 27, 2018 1:41 am
x 2

Re: Something Wrong when i run Sample Browser

Post by saintnick » Thu Feb 14, 2019 1:55 pm

There is a download link for the toolkit on https://developer.nvidia.com/cg-toolkit. You can get cg.dll from "C:\Program Files (x86)\NVIDIA Corporation\Cg\bin" or where ever you decided to install.

If you built Ogre without cg-toolkit installed then you need to run CMake on Ogre again. You should see a new OGRE_BUILD_PLUGIN_CG option. Rebuild with this option checked to get Cg_ProgramManager. These are the steps I had to follow.
1 x

rpgplayerrobin
Greenskin
Posts: 145
Joined: Wed Mar 18, 2009 3:03 am
x 15

Re: Something Wrong when i run Sample Browser

Post by rpgplayerrobin » Thu Feb 14, 2019 9:36 pm

It was a long time ago since I got my cg.dll file and I don't actually remember where I got it, but it was probably from an SDK from nvidia as @saintnick mentioned. Cg is pretty old, so don't get afraid if the dll file is a bit old as well.
1 x

Post Reply