Mar*_*rio 3 c macos xcode llvm ios
我想在我的Mac上编译一个简单的helloworld.c,然后将其发送到我的iphone 4上运行.
代码很简单:
#include <stdio.h>
int main( ) {
printf("Hello, world!\n");
return 0;
}
Run Code Online (Sandbox Code Playgroud)
我的设置:
OSX El Capitain 10.11
Xcode 7.2
Iphone4搭配iOS 7.1.4 JB
clang -v Apple LLVM版本7.0.2(clang-700.1.81)目标:x86_64-apple-darwin15.3.0线程模型:posix
gcc -v配置: - prefix =/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir =/usr/include/c ++/4.2.1 Apple LLVM 7.0.2版(clang -700.1.81)目标:x86_64-apple-darwin15.3.0线程模型:posix
iPhoneOS9.0.2.sdk
我在网上找到的所有信息都没有用,因为新的Xcode或最近OSX上的新编译器.
编译器的正确配置是
clang -isysroot $(xcrun --sdk iphoneos --show-sdk-path) -arch armv7 hello.c -o hello
Run Code Online (Sandbox Code Playgroud)
这将生成一个未经签名的arm二进制文件.
如果您的JB设备需要文件签名,请使用ldid.
| 归档时间: |
|
| 查看次数: |
1825 次 |
| 最近记录: |