Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
可能重复: Android NDK 使用哪个编译器?
我想知道是否可以通过 GCC 编译原生 Android 应用程序。这甚至可能吗?oO
原则上这是可能的,但 Android 旨在运行在许多移动平台上,而 gcc 一次只能针对其中一个平台。因此,该应用程序将无法移植,并且说它运行在 ARM Linux(例如)上比运行在 Android 上更接近事实。
这个和那个问题 还有更多细节。编辑:我首先误读了这意味着 NDK 与股票 gcc 不兼容,但仔细一看,它是兼容的。然而,人们通常使用 NDK 本身附带的稍微修改过的 gcc,这就是您通常开发本机应用程序的方式。
关于长期可移植性的警告仍然适用。