简体   繁体   English

在Win8中使用GCC,C :: B安装Ogre3D

[英]Ogre3D installation with GCC, C::B in Win8

I'm trying to set up a Ogre3D v1.8.1 with Code Blocks 12.11 which has GCC 4.7.0 configured in it. 我正在尝试使用代码块12.11设置一个Ogre3D v1.8.1,其中配置了GCC 4.7.0。 I downloaded the pre compiled version of Ogre3D for MinGW, start up example compiles and executes program without error, but during the initialization of Ogre3D(driver selection screen) some errors occurs and apps freezes. 我下载了用于MinGW的Ogre3D的预编译版本,启动示例可编译并执行程序,而不会出现错误,但是在Ogre3D初始化(驱动程序选择屏幕)期间,会发生一些错误并且应用程序冻结。 Deliberate search on net revealed that there are so many post on internet where many people has stuck on that stage of program that couldn't pass. 网上有意搜索表明,互联网上有如此多的帖子,很多人陷在程序无法通过的那个阶段。

C::B compiler report after Ogre3D scrren crashes Ogre3D scrren崩溃后的C :: B编译器报告

 In __cxa_throw () (D:\Ogre3D_181\OgreSDK_MinGW_v1-8-1\bin\Debug\OgreMain_d.dll)
 87 ..\..\..\..\..\OgreMain\src\OgreConfigFile.cpp: No such file or directory.
 #1  0x009507e9 in Ogre::ConfigFile::loadDirect (this=0x28fc48, filename=...,
 separators=..., trimWhitespace=true) at ..\..\..\..\OgreMain\src\OgreConfigFile.cpp:87
 Debugger finished with status 0

Ogre3D.log report is as shown below Ogre3D.log报告如下所示

 13:19:34: MovableObjectFactory for type 'BillboardSet' registered.
 13:19:34: MovableObjectFactory for type 'ManualObject' registered.
 13:19:34: MovableObjectFactory for type 'BillboardChain' registered.
 13:19:34: MovableObjectFactory for type 'RibbonTrail' registered.
 13:19:34: OGRE EXCEPTION(6:FileNotFoundException): 'plugins.cfg' file not found! in     
 ConfigFile::load at ..\..\..\..\..\OgreMain\src\OgreConfigFile.cpp (line 88)

Based on the complaints produced by Ogre3D and C::B, It may seem that I'm not passing the correct include/source/lib directories and external dependencies correctly but actually I've followed instructions from official Ogre3D site and I'm sure that this is correct because otherwise compiler should have thrown the exception during the compilation. 根据Ogre3D和C :: B的抱怨,似乎我没有正确传递正确的include / source / lib目录和外部依赖关系,但实际上我已经遵循了Ogre3D官方网站的指示,并且我确定这是正确的,因为否则编译器应该在编译过程中抛出异常。 Along with that other users also experienced such kind of problems even though they configure the enviroment properly. 即使他们正确配置了环境,其他用户也遇到了此类问题。

Another Error 另一个错误

  07:09:37: OGRE EXCEPTION(7:InternalErrorException): Unable to compile Cg program      
  Ogre/DualQuaternionHardwareSkinningTwoWeightsTwoPhaseCg: The compile returned an    
  error.DualQuaternion_Common.cg(167) : warning C7019: "blendWgt" is too large for  
   semantic    
  "BLENDWEIGHT", which is size 1
   (0) : error C6007: Constant register limit exceeded; more than 96 constant registers   
   needed to compiled program

   (0) : error C6007: Constant register limit exceeded; more than 96 constant registers   
   needed to compiled program
   (0) : error C6007: Constant register limit exceeded; more than 96 constant registers 
   needed to compiled program
    in CgProgram::compileMicrocode at 
   ..\..\..\..\..\..\PlugIns\CgProgramManager\src\OgreCgProgramManagerDll.cpp (line 67)

Your guidance will be appreicated, 您的指导将不胜感激,

The exception is not complaining about source directories or external dependencies. 唯一的例外是没有抱怨源目录或外部依赖项。 It's complaining about missing plugins.cfg file. 它抱怨缺少plugins.cfg文件。 The most relevant line in the log is this: 日志中最相关的行是这样的:

OGRE EXCEPTION(6:FileNotFoundException): 'plugins.cfg' file not found! OGRE EXCEPTION(6:FileNotFoundException):找不到'plugins.cfg'文件! in... 在...

The location of that file is passed to the constructor of Root . 该文件的位置将传递给Root的构造函数。 The demos probably use the root of working directory . 演示程序可能使用工作目录的根目录 Make sure that the working directory is set correctly and the file is in that path. 确保正确设置了工作目录,并且文件位于该路径中。

See this guide Setting Up An Application - CodeBlocks 请参阅本指南设置应用程序-CodeBlocks

If you want to run your executable from within Code::Blocks, you need to set up 'working directory' and 'command' in the project settings like this: (see the image from that page) 如果要从Code :: Blocks中运行可执行文件,则需要在项目设置中设置“工作目录”和“命令”,如下所示:(请参见该页面的图像)

You can find more basic info about initialization and what plugins.cfg is in this tutorial 您可以在本教程中找到有关初始化以及plugins.cfg是什么的更多基本信息。

Regarding your second error: 关于第二个错误:

As the message clearly states, your Cg program tries to use more registers than are available on your machine. 正如该消息明确指出的那样,您的Cg程序尝试使用的寄存器数量超过了计算机上可用的寄存器数量。 This depends on the graphics cards (which one are you using)? 这取决于显卡(您使用的是哪一张)?

Depending on what you are trying to achieve, you might have to adjust the shaders a bit so that they stay within in the supported bounds of your hardware. 根据您要实现的目标,可能需要稍微调整着色器,以使它们位于硬件支持的范围之内。

See for example this Ogre3D forums thread where something similar happened with the DualQuaternion shader and the user just reduced the bone count. 例如, 请参见此Ogre3D论坛主题 ,其中DualQuaternion着色器发生了类似的情况,而用户仅减少了骨骼数。 On ATI cards, usually only 24 bones are supported in that shader. 在ATI卡上,该着色器通常仅支持24个骨骼。

On important note: Many issues in that area have been fixed with Ogre v1.9, so I would advise you to update if possible. 重要说明: Ogre v1.9解决了该领域的许多问题,因此,我建议您尽可能进行更新。 v1.9 has been stable since quite some time (in fact we are already preparing the next release v.1.0). v1.9自一段时间以来一直稳定(实际上,我们已经在准备下一个版本v.1.0)。

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

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