简体   繁体   English

C ++ Ogre运行时错误“断言失败”

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

Debug Assertion Failed! 调试断言失败!

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

Expression: _pFirstBlock == pHead 表达式:_pFirstBlock == pHead

For information on how your program can cause an assertion 有关程序如何引起断言的信息
failure, see the Visual C++ documentation on asserts. 失败,请参见有关断言的Visual C ++文档。

(Press Retry to debug the application) (按重试可调试应用程序)

That's what I got when I try to execute my Ogre application. 这就是我尝试执行Ogre应用程序时得到的。 Source is a total copy of Ogre Tutorial Framework. 来源是Ogre教程框架的完整副本。 I found ridiculously much exceptions from Ogre.log. 我从Ogre.log中发现了很多荒谬的异常。 It seems like that all of the errors came from OgreGpuProgramParams.cpp and OgreResourceGroupManager.cpp . 似乎所有错误都来自OgreGpuProgramParams.cppOgreResourceGroupManager.cpp Some of the first ones coming next. 接下来的一些第一批。 I couldn't paste em all, because there's about 1000 lines of that crap. 我无法全部粘贴它们,因为大约有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)

Notice, that those errors came only when using OpenGL or D3D9 rendersystems. 注意,这些错误仅在使用OpenGL或D3D9渲染系统时出现。 When using D3D11, runtime error is different: 使用D3D11时,运行时错误有所不同:

OGRE EXCEPTION(3:RenderingAPIException): Attemped to render to a D3D11 device without both vertex and fragment shaders there is no fixed pipeline in d3d11 - use the RTSS or write custom shaders. OGRE EXCEPTION(3:RenderingAPIException):尝试渲染到既没有顶点着色器又没有片段着色器的D3D11设备,d3d11中没有固定的管道-使用RTSS或编写自定义着色器。 in D3D11RenderSystem::_render at ..........\\RenderSystems\\Direct3D11\\src\\OgreD3D11RenderSystem.cpp (line 2496) 在.......... \\ RenderSystems \\ Direct3D11 \\ src \\ OgreD3D11RenderSystem.cpp的D3D11RenderSystem :: _ render中(第2496行)

I can paste even more info is it's necessary. 如果有必要,我可以粘贴更多信息。 Does anybody know a solution? 有人知道解决方案吗?

This error usually appears if you are mixing release and debug builds. 如果您混用发行版和调试版,则通常会出现此错误。 Most likely your application was built in release mode while you are trying to use debug build DLLs in this case of Ogre. 在这种情况下,如果您尝试使用调试生成DLL,则很可能是在发布模式下构建了您的应用程序。

You can use a tool such as Dependency Walker to check what DLLs exactly are loaded during your application's run. 您可以使用Dependency Walker之类的工具来检查在应用程序运行期间准确加载了哪些DLL。

Another reason could that your Ogre DLLs where generated by a different IDE/compiler version than your actual application is. 另一个原因可能是您的Ogre DLL是由与实际应用程序不同的IDE /编译器版本生成的。 This will often make them binary-incompatible resulting in crashes. 这通常会使它们与二进制不兼容,从而导致崩溃。 This can happen due to different versions of the standard library and associated dynamic allocation issues. 这可能是由于标准库的版本不同以及相关的动态分配问题引起的。 The same is possible if you build the Ogre libraries as 'static', but use dynamic dependencies (eg OIS, plugins, etc.). 如果将Ogre库构建为“静态”,但使用动态依赖项(例如OIS,​​插件等),则可能会发生同样的情况。

Regarding the errors in the log: You seem to be missing some media files (eg shaders) which cause those log entries. 关于日志中的错误:您似乎缺少引起这些日志条目的某些媒体文件(例如,着色器)。

Regarding D3D11: With that version Microsoft removed the FFP (fixed-function pipeline). 关于D3D11:Microsoft使用该版本删除了FFP(固定功能管道)。 So everything is now shader based which means that you either have to write/provide these on your own or use Ogre's integrated shader generator ( RTTS ). 因此,现在所有内容都是基于着色器的,这意味着您要么必须自己编写/提供这些着色器,要么使用Ogre的集成着色器生成器( RTTS )。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM