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

I installed gcc, but when I execute this command:

gcc test.c

He tells 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' 

code>

test.c:

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

code>

+4
source share
2 answers

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

+3
source

You need to add -I/var/include . iphone-gcc does not notice that most of the main headers are in this folder and search in another directory, which you can see with gcc -v test.c Try this method or copy all the headers and libraries from the SDK (preferably from the same version of iOS as yours) to / usr / include and / usr / lib. You will still need Frameworks in the / Library / Frameworks section, or you will need to add the location through which they are located through -F/path/to/framework/from/sdk

+1
source

Source: https://habr.com/ru/post/1335980/


All Articles