Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/139.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ C++;Ogre运行时错误';断言失败';_C++_Runtime Error_Assert_Ogre - Fatal编程技术网

C++ C++;Ogre运行时错误';断言失败';

C++ C++;Ogre运行时错误';断言失败';,c++,runtime-error,assert,ogre,C++,Runtime Error,Assert,Ogre,调试断言失败 程序:…ments\Visual Studio 2013\Projects\OgreTest\Debug\OgreTest.exe 文件:f:\dd\vctools\crt\crtw32\misc\dbgheap.c 电话号码:1424 表达式:_pFirstBlock==pHead 有关程序如何导致断言的信息 失败, 有关Asvest.Vis/C++文档的查看。 (按“重试”调试应用程序) 这就是我尝试执行我的食人魔应用程序时得到的结果。源代码是Ogre教程框架的完整副本。我在O

调试断言失败

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

表达式:_pFirstBlock==pHead

有关程序如何导致断言的信息
失败, 有关Asvest.Vis/C++文档的查看。 (按“重试”调试应用程序)

这就是我尝试执行我的食人魔应用程序时得到的结果。源代码是Ogre教程框架的完整副本。我在Ogre.log中发现了很多异常。似乎所有的错误都来自
OgreGpuProgramParams.cpp
OgreResourceGroupManager.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时,运行时错误不同:

食人魔异常(3:RenderingAPIException):尝试渲染到D3D11 没有顶点和片段着色器的设备没有固定的 d3d11中的管道-使用RTS或编写自定义着色器。在里面 D3D11渲染系统::_在 ……。\RenderSystems\Direct3D11\src\OgreD3D11RenderSystem.cpp (第2496行)


我可以粘贴更多的信息,这是必要的。有人知道解决方案吗?

如果您混合发布版本和调试版本,通常会出现此错误。在本例中,当您尝试使用调试构建DLL时,您的应用程序很可能是在发布模式下构建的

您可以使用诸如之类的工具来检查在应用程序运行期间究竟加载了哪些DLL

另一个原因可能是您的Ogre DLL是由与实际应用程序不同的IDE/编译器版本生成的。这通常会使它们二进制不兼容,从而导致崩溃。这可能是由于标准库的不同版本以及相关的动态分配问题造成的。如果您将Ogre库构建为“静态”库,但使用动态依赖项(例如OIS、插件等),则同样可能

关于日志中的错误:您似乎缺少一些媒体文件(例如着色器),这些文件会导致这些日志条目


关于D3D11:在该版本中,微软删除了FFP(固定功能管道)。所以现在一切都是基于着色器的,这意味着你要么自己编写/提供这些,要么使用食人魔的集成着色器生成器()

如果不知道导致问题的编码行,我们很难猜测。关于崩溃,调试器告诉您什么?你注意到食人魔版本了吗?@PhilipAllgaier Crash来自
mRoot->startRendering()
。我的Ogre版本是1.9.0。我的问题与上面相同,但使用的是VS 2015:(我用你推荐的工具检查了我的exe,它说我的程序使用了以下dll:OgreMain_d.dll、OgreOverlay_d.dll、OIS_d.dll、user32.dll、MSVCP120D.dll、boost_system-vc120-mt-gd-1_55.dll、MSVCR120D.dll和kernel32.dll。所以它们都是调试dll(不是吗?)。是的,我的程序是调试版本。@user3725053添加了关于编译器版本的注释。