我在配置-sdk时对CC使用了"xcrun ffmpeg iphonesimulator clang“。
xcrun -sdk unable模拟器clang无法创建可执行文件。如果xcrun启用option模拟器clang是交叉编译器,请使用-sdk -cross-compile选项。只有在你知道交叉编译是什么意思的情况下,才能这样做。C编译器测试失败。
xcode5很好。
===========更新========我添加了一个测试,似乎没有链接模拟器的_start。
AGSPC98:pwd fluke$ cat> ~/tmp/ios.c
int main(void){ return 0; }
AGSPC98:pwd fluke$ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -fasm -fno-short-enums -fno-strict-aliasing -arch i386 -miphoneos-version-min=5.0 -g -fno-inline-functions -O0 -falign-functions=4 -DDEBUG=1 -DVPLAYER_IOS=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.0.sdk -c -o ~/tmp/ios.o ~/tmp/ios.c
AGSPC98:pwd fluke$
AGSPC98:pwd fluke$ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.0.sdk -arch i386 -miphoneos-version-min=5.0 -o ~/tmp/ios ~/tmp/ios.o
Undefined symbols for architecture i386:
"start", referenced from:
implicit entry/start for main executable
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
AGSPC98:pwd fluke$ nm ~/tmp/ios.o
00000000 T _main发布于 2014-09-25 01:05:04
将-miphoneos-version-min=5.0更改为-miphoneos-version-min=6.0会使一切正常。
https://stackoverflow.com/questions/25892446
复制相似问题