2012-06-04 302 views
0

我在PC上設置了Ogre和依賴關係,並下載了一些Ogre應用程序。當我啓動我剛剛下載的項目的新exe文件時,它會生成以下錯誤:發生了Ogre SDK異常

05:37:59: Loading library C:/OgreSDK_vc9_v1-7-1/bin/debug\RenderSystem_Direct3D9_d 
05:37:59: OGRE EXCEPTION(7:InternalErrorException): Could not load dynamic library C  :/OgreSDK_vc9_v1-7-1/bin/debug\RenderSystem_Direct3D9_d. System Error: The specified module could not be found. 

in DynLib::load at ..\..\..\..\OgreMain\src\OgreDynLib.cpp (line 91) 

任何幫助,將不勝感激。

在此先感謝。

+0

您是否檢查過要加載的文件實際上是否存在,並在給定的路徑中? –

+0

所以你說我應該正確配置我的cfg文件? –

+0

另外,寫下一些答案,所以我可以聲明它是建議的,因爲我已經根據你的話想出瞭如何讓它工作。 ;) –

回答

1

在創建中央Ogre3D類Ogre::Root後,您需要傳遞包含所有要加載的Ogre插件的* .CFG文件的名稱,例如上述D3D9渲染系統。

該文件需要由默認旁邊的* .EXE和應該像這樣(在最小的形式,其中僅D3D9渲染系統加載和匹配的DLL文件駐留在旁邊這個CFG文件):

# Defines plugins to load 

# Define plugin folder 
PluginFolder=. 

# Define plugins 
Plugin=RenderSystem_Direct3D9 

欲瞭解更多信息,看看這個section in the Ogre3D tutorial 1

0

這花了我一段時間,直到我想通了。 dll(RenderSystem_Direct3D9_d)錯過了,因爲你沒有編譯它 - 它是OGRE.sln中同名(RenderSystem_Direct3D9)的項目我正在使用OGRE 2.1,所以我缺少的dll是RenderSystem_Direct3D11_d.dll而不是像你的RenderSystem_Direct3D9_d.dll,但修復方法類似,只需構建該dll的項目,如下圖所示。 OgreMain_RenderSystem_Direct3D11

無論如何,作爲一個初學者,爲了避免任何麻煩,只需點擊F6來構建完整的解決方案。