第一次运行physX+ogre的例子遇到的异常:
找不到文件,去OgreSDK里面找到这个resources_d.cfg 拷到和*.sln 同级的目录下面
然后又产生了这个问题。百度说:
----------------------------------------------------------------------------------------------------------------------------------------------------------
OGRE EXCEPTION(7:InternalErrorException): ../../media/packs/SDKTrays.zip - error whilst opening archive: Unable to read zip file
SDKTrays.zip应该是一个资源文件,出这个错一般是因为bin/debug下的 resources_d.cfg这个配置文件找不到SDKTrays.zip这个文件(文件不存在)或者是路径写错了。于是是赶紧去检查目录下该文件是否存在,结果发现原来没有media目录(该目录保存着各个例子需要的资源文件),于是去SDK下把它的media目录copy到我们新建的项目目录下来 (与Bin,samples等目录同级),再运行。这次终于可以了。
----------------------------------------------------------------------------------------------------------------------------------------------------------
但是我的不是这个问题,我的resources_d.cfg里面是这样写的:
# Resources required by the sample browser and most samples.
[Essential]
Zip=../../media/packs/SdkTrays.zip
FileSystem=../../media/thumbnails
# Common sample resources needed by many of the samples.
# Rarely used resources should be separately loaded by the
# samples which require them.
[Popular]
FileSystem=../../media/fonts
FileSystem=../../media/materials/programs
FileSystem=../../media/materials/scripts
FileSystem=../../media/materials/textures
FileSystem=../../media/materials/textures/nvidia
FileSystem=../../media/models
FileSystem=../../media/particle
FileSystem=../../media/DeferredShadingMedia
FileSystem=../../media/PCZAppMedia
FileSystem=../../media/RTShaderLib
FileSystem=../../media/RTShaderLib/materials
Zip=../../media/packs/cubemap.zip
Zip=../../media/packs/cubemapsJS.zip
Zip=../../media/packs/dragon.zip
Zip=../../media/packs/fresneldemo.zip
Zip=../../media/packs/ogretestmap.zip
Zip=../../media/packs/ogredance.zip
Zip=../../media/packs/Sinbad.zip
Zip=../../media/packs/skybox.zip
[General]
FileSystem=../../media
接着找
在wiki上面看到的(http://www.ogre3d.org/tikiwiki/Building+Ogre+with+CMake)
----------------------------------------------------------------------------------------------------------------------------------------------------------
If you are installin in an ipod / iphone, see the first troubleshooting link:
Creating resource group Essential
Added resource location '/Users/taehyungkim/Documents/ogre_src_v1-7-1-2/Samples/Media/thumbnails' of type 'FileSystem' to resource group 'Essential'
Current language: auto; currently c++
(gdb) continue
An exception has occurred: OGRE EXCEPTION(7:InternalErrorException): <path>/Media/packs/SdkTrays.zip - error whilst opening archive: Unable to read zip file. in ZipArchive::checkZzipError at <path>/OgreMain/src/OgreZip.cpp (line 280)
Looks like your app can't read the zip file. My guess is that your resources.cfg contains absolute paths to the resources and it's trying to load files that are outside the application bundle.
Change it to use absolute paths instead, like this:
Code: Select all
Zip=Media/packs/SdkTrays.zip
----------------------------------------------------------------------------------------------------------------------------------------------------------
# Resources required by the sample browser and most samples.
[Essential]
Zip=D:/OGRE/OgreSDK_vc10_v1-7-4/media/packs/SdkTrays.zip
FileSystem=../../media/thumbnails
# Common sample resources needed by many of the samples.
# Rarely used resources should be separately loaded by the
# samples which require them.
[Popular]
FileSystem=D:/OGRE/OgreSDK_vc10_v1-7-4/media/fonts
FileSystem=D:/OGRE/OgreSDK_vc10_v1-7-4/media/materials/programs
FileSystem=D:/OGRE/OgreSDK_vc10_v1-7-4/media/materials/scripts
FileSystem=D:/OGRE/OgreSDK_vc10_v1-7-4/media/materials/textures
FileSystem=D:/OGRE/OgreSDK_vc10_v1-7-4/media/materials/textures/nvidia
FileSystem=D:/OGRE/OgreSDK_vc10_v1-7-4/media/models
FileSystem=D:/OGRE/OgreSDK_vc10_v1-7-4/media/particle
FileSystem=D:/OGRE/OgreSDK_vc10_v1-7-4/media/DeferredShadingMedia
FileSystem=D:/OGRE/OgreSDK_vc10_v1-7-4/media/PCZAppMedia
FileSystem=D:/OGRE/OgreSDK_vc10_v1-7-4/media/RTShaderLib
FileSystem=D:/OGRE/OgreSDK_vc10_v1-7-4/media/RTShaderLib/materials
Zip=D:/OGRE/OgreSDK_vc10_v1-7-4/media/packs/cubemap.zip
Zip=D:/OGRE/OgreSDK_vc10_v1-7-4/media/packs/cubemapsJS.zip
Zip=D:/OGRE/OgreSDK_vc10_v1-7-4/media/packs/dragon.zip
Zip=D:/OGRE/OgreSDK_vc10_v1-7-4/media/packs/fresneldemo.zip
Zip=D:/OGRE/OgreSDK_vc10_v1-7-4/media/packs/ogretestmap.zip
Zip=D:/OGRE/OgreSDK_vc10_v1-7-4/media/packs/ogredance.zip
Zip=D:/OGRE/OgreSDK_vc10_v1-7-4/media/packs/Sinbad.zip
Zip=D:/OGRE/OgreSDK_vc10_v1-7-4/media/packs/skybox.zip
[General]
FileSystem=D:/OGRE/OgreSDK_vc10_v1-7-4/media