Xcode 4中的“环境变量太长”

时间:2011-07-12 00:30:46

标签: xcode xcode4 gdb environment-variables dyld

我有一个由cmake生成的Xcode 4项目。

当我构建并尝试在我的iOS设备(ipod / ipad)上进行调试时

gdb控制台打印此消息:

warning: Environment variable too long, skipping: DYLD_FRAMEWORK_PATH=/Users/dokinkon/src/gamekit/build_iphone/Samples/IPhoneDemo/bin-iphoneos/Release:/Users/dokinkon/src/gamekit/build_iphone/Dependencies/Source/GameKit/Utils/bin-iphoneos/Release:/Users/dokinkon/src/gamekit/build_iphone/Dependencies/Source/GameKit/AnimKit/bin-iphoneos/Release:/Users/dokinkon/src/gamekit/build_iphone/Dependencies/Source/Blender25/Serialize/BlenderSerialize/bin-iphoneos/Release:/Users/dokinkon/src/gamekit/build_iphone/Dependencies/Source/Blender25/Serialize/BulletFileLoader/bin-iphoneos/Release:/Users/dokinkon/src/gamekit/build_iphone/Dependencies/Source/FreeImage/ZLib/bin-iphoneos/Release:/Users/dokinkon/src/gamekit/build_iphone/Dependencies/Source/FreeType/bin-iphoneos/Release:/Users/dokinkon/src/gamekit/build_iphone/Dependencies/Source/OIS/bin-iphoneos/Release:/Users/dokinkon/src/gamekit/build_iphone/Dependencies/Source/Codecs/bin-iphoneos/Release:/Users/dokinkon/src/gamekit/build_iphone/Dependencies/Source/Lua/lua/bin-iphoneos/Release:/Users/dokinkon/src/gamekit/build_iphone/Dependencies/Source/FreeImage/bin-iphoneos/Release:/Users/dokinkon/src/gamekit/build_iphone/Ogre-1.8/OgreMain/bin-iphoneos/Release:/Users/dokinkon/src/gamekit/build_iphone/bullet/src/BulletDynamics/bin-iphoneos/Release:/Users/dokinkon/src/gamekit/build_iphone/bullet/src/BulletCollision/bin-iphoneos/Release:/Users/dokinkon/src/gamekit/build_iphone/bullet/src/LinearMath/bin-iphoneos/Release:/Users/dokinkon/src/gamekit/build_iphone/Ogre-1.8/RenderSystems/GLES/bin-iphoneos/Release:/Users/dokinkon/src/gamekit/build_iphone/Ogre-1.8/PlugIns/ParticleFX/bin-iphoneos/Release:/Users/dokinkon/src/gamekit/build_iphone/Engine/bin-iphoneos/Release

gdb连续打印这些消息,以至于我无法调试我的程序。

我确定我没有设置DYLD_FRAMEWORK_PATH。 也许xcode4或cmake可以在某处设置/取消设置这个环境变量?

我已经尝试过重置DYLD_FRAMEWORK_PATH,就像这个答案一样,但不起作用 How do I set up environment variables for my product in Xcode 4?

由于

1 个答案:

答案 0 :(得分:0)

不确定这是否是您的问题,但是如果您在目标的构建设置中设置了标题/框架/库搜索路径并点击了递归复选框,它将以递归方式添加每个子路径。这可能是大量的路径(一个字符串太长,以适应env var)。这给我带来了类似的问题。

在这种情况下,我真正想做的是为主标题或框架的特定框架或文件夹添加一个搜索路径。一旦我进行了调整,它就运行良好。