相关疑难解决方法(0)

为MacOSX构建,但链接针对iOS模拟器文件构建的dylib

我刚刚使用2013年4月15日的命令行工具升级到Xcode 5 beta,并且在标准CMakeTestCCompiler.cmake尝试编译简单测试程序期间运行cmake构建时遇到以下警告:

cmake -version
cmake version 2.8.11.2

ld: building for MacOSX, but linking against dylib built for iOS Simulator file '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/usr/lib/libSystem.dylib' for architecture i386

lipo -info /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/usr/lib/libSystem.dylib
Non-fat file: libSystem.dylib is architecture: i386
Run Code Online (Sandbox Code Playgroud)

编译步骤是:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk -o /Users/temp/testCCompiler.c.o -c /Users/temp/testCCompiler.c

lipo -info /Users/temp/testCCompiler.c.o 
Non-fat file: testCCompiler.c.o is architecture: i386
Run Code Online (Sandbox Code Playgroud)

链接步骤是:

/usr/local/bin/cmake -E cmake_link_script /Users/temp/link.txt --verbose=1
Run Code Online (Sandbox Code Playgroud)

其中link.txt包含:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk -Wl,-headerpad_max_install_names /Users/temp/testCCompiler.c.o -o testCCompiler
Run Code Online (Sandbox Code Playgroud)

似乎testCCompiler.co和libSystem.dylib都是i386,i386是在link.txt中指定的,而i386是模拟器的正确架构,所以我不确定为什么它认为它是为MacOSX构建的.也许命令行选项是错误的:(.

谢谢你的帮助!

c cmake clang ld

11
推荐指数
1
解决办法
1万
查看次数

将.wav文件转换为.mp3

我想将以.wav文件格式保存的音频文件转换为.mp3格式的文件.

请建议我如何通过Objective C编码实现这一目标.

提前致谢.

iphone audio objective-c core-audio

7
推荐指数
2
解决办法
8392
查看次数

标签 统计

audio ×1

c ×1

clang ×1

cmake ×1

core-audio ×1

iphone ×1

ld ×1

objective-c ×1