簡體   English   中英

C ++ Ogre運行時錯誤“斷言失敗”

[英]C++ Ogre Runtime error 'Assertion failed'

調試斷言失敗!

程序:... ments \\ Visual Studio 2013 \\ Projects \\ OgreTest \\ Debug \\ OgreTest.exe
文件:f:\\ dd \\ vctools \\ crt \\ crtw32 \\ misc \\ dbgheap.c
線:1424

表達式:_pFirstBlock == pHead

有關程序如何引起斷言的信息
失敗,請參見有關斷言的Visual C ++文檔。

(按重試可調試應用程序)

這就是我嘗試執行Ogre應用程序時得到的。 來源是Ogre教程框架的完整副本。 我從Ogre.log中發現了很多荒謬的異常。 似乎所有錯誤都來自OgreGpuProgramParams.cppOgreResourceGroupManager.cpp 接下來的一些第一批。 我無法全部粘貼它們,因為大約有1000行。

17:55:32: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource DualQuaternion.cg in resource group Popular or any other group. in ResourceGroupManager::openResource at ..\..\..\..\OgreMain\src\OgreResourceGroupManager.cpp (line 756)
17:55:32: High-level program Ogre/DualQuaternionHardwareSkinningTwoWeightsCg encountered an error during loading and is thus not supported.
OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource DualQuaternion.cg in resource group Popular or any other group. in ResourceGroupManager::openResource at ..\..\..\..\OgreMain\src\OgreResourceGroupManager.cpp (line 756)
17:55:32: OGRE EXCEPTION(2:InvalidParametersException): Named constants have not been initialised, perhaps a compile error. in GpuProgramParameters::_findNamedConstantDefinition at ..\..\..\..\OgreMain\src\OgreGpuProgramParams.cpp (line 1709)
17:55:32: Compiler error: invalid parameters in DualQuaternion.program(14): setting of constant failed
17:55:32: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource DualQuaternion.cg in resource group Popular or any other group. in ResourceGroupManager::openResource at ..\..\..\..\OgreMain\src\OgreResourceGroupManager.cpp (line 756)
17:55:32: High-level program Ogre/DualQuaternionHardwareSkinningTwoWeightsTwoPhaseCg encountered an error during loading and is thus not supported.
OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource DualQuaternion.cg in resource group Popular or any other group. in ResourceGroupManager::openResource at ..\..\..\..\OgreMain\src\OgreResourceGroupManager.cpp (line 756)
17:55:32: OGRE EXCEPTION(2:InvalidParametersException): Named constants have not been initialised, perhaps a compile error. in GpuProgramParameters::_findNamedConstantDefinition at ..\..\..\..\OgreMain\src\OgreGpuProgramParams.cpp (line 1709)
17:55:32: Compiler error: invalid parameters in DualQuaternion.program(28): setting of constant failed
17:55:32: Parsing script Examples.program
17:55:32: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource Example_Basic.cg in resource group Popular or any other group. in ResourceGroupManager::openResource at ..\..\..\..\OgreMain\src\OgreResourceGroupManager.cpp (line 756)
17:55:32: High-level program Ogre/BasicVertexPrograms/AmbientOneTextureCg encountered an error during loading and is thus not supported.
OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource Example_Basic.cg in resource group Popular or any other group. in ResourceGroupManager::openResource at ..\..\..\..\OgreMain\src\OgreResourceGroupManager.cpp (line 756)
17:55:32: OGRE EXCEPTION(2:InvalidParametersException): Named constants have not been initialised, perhaps a compile error. in GpuProgramParameters::_findNamedConstantDefinition at ..\..\..\..\OgreMain\src\OgreGpuProgramParams.cpp (line 1709)
17:55:32: Compiler error: invalid parameters in Examples.program(16): setting of constant failed
17:55:32: OGRE EXCEPTION(2:InvalidParametersException): Named constants have not been initialised, perhaps a compile error. in GpuProgramParameters::_findNamedConstantDefinition at ..\..\..\..\OgreMain\src\OgreGpuProgramParams.cpp (line 1709)
17:55:32: Compiler error: invalid parameters in Examples.program(17): setting of constant failed
17:55:32: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource Example_Basic.cg in resource group Popular or any other group. in ResourceGroupManager::openResource at ..\..\..\..\OgreMain\src\OgreResourceGroupManager.cpp (line 756)
17:55:32: High-level program Ogre/HardwareSkinningFourWeights encountered an error during loading and is thus not supported.
OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource Example_Basic.cg in resource group Popular or any other group. in ResourceGroupManager::openResource at ..\..\..\..\OgreMain\src\OgreResourceGroupManager.cpp (line 756)
17:55:32: OGRE EXCEPTION(2:InvalidParametersException): Named constants have not been initialised, perhaps a compile error. in GpuProgramParameters::_findNamedConstantDefinition at ..\..\..\..\OgreMain\src\OgreGpuProgramParams.cpp (line 1709)
17:55:32: Compiler error: invalid parameters in Examples.program(314): setting of constant failed
17:55:32: OGRE EXCEPTION(2:InvalidParametersException): Named constants have not been initialised, perhaps a compile error. in GpuProgramParameters::_findNamedConstantDefinition at ..\..\..\..\OgreMain\src\OgreGpuProgramParams.cpp (line 1709)
17:55:32: Compiler error: invalid parameters in Examples.program(315): setting of constant failed
17:55:32: OGRE EXCEPTION(2:InvalidParametersException): Named constants have not been initialised, perhaps a compile error. in GpuProgramParameters::_findNamedConstantDefinition at ..\..\..\..\OgreMain\src\OgreGpuProgramParams.cpp (line 1709)
17:55:32: Compiler error: invalid parameters in Examples.program(316): setting of constant failed
17:55:32: OGRE EXCEPTION(2:InvalidParametersException): Named constants have not been initialised, perhaps a compile error. in GpuProgramParameters::_findNamedConstantDefinition at ..\..\..\..\OgreMain\src\OgreGpuProgramParams.cpp (line 1709)

注意,這些錯誤僅在使用OpenGL或D3D9渲染系統時出現。 使用D3D11時,運行時錯誤有所不同:

OGRE EXCEPTION(3:RenderingAPIException):嘗試渲染到既沒有頂點着色器又沒有片段着色器的D3D11設備,d3d11中沒有固定的管道-使用RTSS或編寫自定義着色器。 在.......... \\ RenderSystems \\ Direct3D11 \\ src \\ OgreD3D11RenderSystem.cpp的D3D11RenderSystem :: _ render中(第2496行)

如果有必要,我可以粘貼更多信息。 有人知道解決方案嗎?

如果您混用發行版和調試版,則通常會出現此錯誤。 在這種情況下,如果您嘗試使用調試生成DLL,則很可能是在發布模式下構建了您的應用程序。

您可以使用Dependency Walker之類的工具來檢查在應用程序運行期間准確加載了哪些DLL。

另一個原因可能是您的Ogre DLL是由與實際應用程序不同的IDE /編譯器版本生成的。 這通常會使它們與二進制不兼容,從而導致崩潰。 這可能是由於標准庫的版本不同以及相關的動態分配問題引起的。 如果將Ogre庫構建為“靜態”,但使用動態依賴項(例如OIS,​​插件等),則可能會發生同樣的情況。

關於日志中的錯誤:您似乎缺少引起這些日志條目的某些媒體文件(例如,着色器)。

關於D3D11:Microsoft使用該版本刪除了FFP(固定功能管道)。 因此,現在所有內容都是基於着色器的,這意味着您要么必須自己編寫/提供這些着色器,要么使用Ogre的集成着色器生成器( RTTS )。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM