HiTECNOLOGYs
HiTECNOLOGYs

Reputation: 327

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;
}

Upvotes: 4

Views: 2667

Answers (2)

LeoTh3o
LeoTh3o

Reputation: 11

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

Upvotes: 1

Bunk3r
Bunk3r

Reputation: 46

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.

Upvotes: 3

Related Questions