我是iphone开发的新手。在linux下的Iphone开发可以通过toolchain获得。我已经在linux中安装了toolchain2,并创建了一个名为"helloworld.m“的文件。
文件中的代码如下所示
#include <stdio.h>
int main(void){
printf("Bismillah");
return;
}我尝试使用下面的命令编译它,该命令创建了一个"helloworld.o“文件。
root@mzeeshan-desktop:/usr/toolchain2# /usr/toolchain2/pre/bin/arm-apple-darwin9-g++ -c helloworld.m在上面的命令之后,我尝试通过下面给出的命令创建可执行文件,其中cerates helloworld可执行文件
/usr/toolchain2/pre/bin/arm-apple-darwin9-g++ helloworld.o -o helloworld 现在是时候使用命令./helloworld运行此可执行文件了,该命令显示"bash:./helloworld: cannot execute binary file“。
我不知道该怎么做,有人能帮我吗?我怎样才能执行这个程序?
另外,我开发iphone应用程序的方式正确吗?
发布于 2011-02-16 17:57:09
您不能在Linux/x86-64上运行为iOS/ARM构建的可执行文件。您需要将可执行文件上传到iOS平台(iPhone、iPod Touch、AppleTV 2G)才能运行。
顺便说一句,当您将二进制文件上传到iPhone时,您需要对其执行pseudo-sign
ldid -S helloworld发布于 2011-02-16 20:38:27
尽管可以在Linux上编写和运行Objective-C程序,但您需要Cocoa-Touch框架和iOS SDK,这在Linux机器上是无法获得的。所以它不会帮助你编写iPhone应用程序。
https://stackoverflow.com/questions/5014918
复制相似问题