ios - 从命令行为 armv7、armv7s 构建最小的 c++

标签 ios build

我有一个非常简单的源文件foo.cpp:

#include <stdio.h>
int foo() {
    printf("foo\n");
    return 11;
}

我想构建一个架构为 armv7 的对象 foo.o。我想完全从命令行(即没有 Xcode 项目)来做到这一点。首先我尝试了:

g++ -arch armv7 -c foo.cpp

我收到的错误是:

llvm-g++-4.2: error trying to exec '/usr/bin/../llvm-gcc-4.2/bin/arm-apple-darwin11-llvm-g++-4.2': execvp: No such file or directory

最佳答案

IOSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer
$IOSROOT/usr/bin/g++ -c foo.cpp -arch armv7s -isysroot $IOSROOT/SDKs/iPhoneOS6.0.sdk

关于ios - 从命令行为 armv7、armv7s 构建最小的 c++,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13805302/

相关文章:

ios - 'NSSet ?' does not contain a member called ' 生成器'

ios - 如何在非根 Controller View 中创建导航 Controller ?

database - 触发 Jenkins 基于数据库更改构建

java - Gradle 中任务类型的继承树

node.js - 尝试更新 Docker 中的 NPM : code EISDIR

javascript - 构建 Meteor 应用程序返回错误 : EPERM, 符号链接(symbolic link)

ios - UICollectionView 在加载图像后调整图像大小

iphone - 如何删除自定义导航栏图像?

ios - UIcollectionView 间距

android - 在 android NDK 中使用 Vanilla GCC(或 Clang)