cross compile c program for android

I have a c program that uses -lpcap, -lm, and -lpthread. I see the libraries in /usr/arm-linuxgnueabi/lib/. However, if I compile using the command

arm-linux-gnueabi-gcc -static *.c -L/usr/arm-linux-gnueabi/lib/ -lpcap -lm -lpthread -o dumps/forandroid

It gives the following error:

/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/../../../../arm-linux-gnueabi/bin/ld: cannot find crt1.o: No such file or directory<br>
/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/../../../../arm-linux-gnueabi/bin/ld: cannot find crti.o: No such file or directory<br>
/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/../../../../arm-linux-gnueabi/bin/ld: cannot find -lpcap<br>
/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/../../../../arm-linux-gnueabi/bin/ld: cannot find -lm<br>
/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/../../../../arm-linux-gnueabi/bin/ld: cannot find -lpthread
/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/../../../../arm-linux-gnueabi/bin/ld: cannot find -lc<br>
collect2: error: ld returned 1 exit status

How can I give the library path properly? I am trying to compile the program for android emulator running android 5.1. I am using mint 17.2 64 bit amd machine.


Source: gcc

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.