开发者

How to compile objc(c++, c) source on jailbroken iPad?

I've installed gcc but when I execute this comand:

gcc test.c

It says me:

开发者_高级运维 test.c:1:18: error: stdio.h: No such file or directory

test.c: In function 'main':

test.c:5: warning: incompatible implicit declaration of builit-in function 'printf'

Test.c:

#include <stdio.h>
int main(void)
{
    printf("Hello, World!\n");
    return 0;
}


Well i just did the same, but you need to copy the header files into the ipad /usr/include via SSH but after that i keep getting other errors so there must be another step after copying the headers.


You need to add -I/var/include. iphone-gcc fails to notice that most of the main headers needed are under that folder and search on other directory that you can see with gcc -v test.c. Try this way or copy all the headers and libraries from an SDK (preferably from the same of the iOS version you have) to /usr/include and /usr/lib. You'll still need the Frameworks under /Library/Frameworks or you'll have to add the location they are via -F/path/to/framework/from/sdk

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜