Lyle Zumbrun
unread,May 18, 2011, 7:02:43 PM5/18/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to android-ndk
I am trying to compile Linphone under Cygwin using the arm-linux-
androideabi-gcc compiler, but am having trouble with the -include
command line option with a /cygdrive... path. A simplified test case
follows showing that the the -include option can be used with the
native compiler to include test.h either from the current directory
without specifying a path, or by specifying the entire path starting
with /cygdrive/... With the cross-compiler, -include works with the
header file in the current directory or with a relative path, but not
with a path starting with /cygdrive/...
In other words, it seems that the cross-compiler's -include option
doesn't work in some cases where the native compiler does. What am I
doing wrong? Do I have the wrong compiler? Thanks for any
suggestions:
# Native compiler, just shows that gets an error if compiled without
test.h. The cross-complier does too.
$ /cygdrive/c/android-ndk-r5b/toolchains/arm-linux-androideabi-4.4.3/
prebuilt/windows/bin/arm-linux-androideabi-gcc test.c
test.c: In function 'main':
test.c:7: error: 'MY_STRING' undeclared (first use in this function)
test.c:7: error: (Each undeclared identifier is reported only once
test.c:7: error: for each function it appears in.)
# Native compiler works with test.h in the current directory
$ gcc -include test.h test.c
# Native compiler: works with path to test.h
$ gcc -include /cygdrive/c/android-ndk-r5b/test.h test.c
# Cross-compiler, gets to the link step if don't use a path to test.h
$ /cygdrive/c/android-ndk-r5b/toolchains/arm-linux-androideabi-4.4.3/
prebuilt/windows/bin/arm-linux-androideabi-gcc -include test.h test.c
C:/android-ndk-r5b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/
windows/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-
linux-androideabi/bin/ld.exe: crtbegin_dynamic.o: No such file: No
such file or directory
collect2: ld returned 1 exit status
# Cross-compiler, gets to the link step with a relative path to test.h
$ /cygdrive/c/android-ndk-r5b/toolchains/arm-linux-androideabi-4.4.3/
prebuilt/windows/bin/arm-linux-androideabi-gcc -include ../android-ndk-
r5b/test.h test.c
C:/android-ndk-r5b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/
windows/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-
linux-androideabi/bin/ld.exe: crtbegin_dynamic.o: No such file: No
such file or directory
collect2: ld returned 1 exit status
# Cross-compiler, can't find test.h using -include option with path
starting with /cygdrive/...
$ /cygdrive/c/android-ndk-r5b/toolchains/arm-linux-androideabi-4.4.3/
prebuilt/windows/bin/arm-linux-androideabi-gcc -include /cygdrive/c/
android-ndk-r5b/test.h test.c
cc1.exe: error: /cygdrive/c/android-ndk-r5b/test.h: No such file or
directory
test.c: In function 'main':
test.c:7: error: 'MY_STRING' undeclared (first use in this function)
test.c:7: error: (Each undeclared identifier is reported only once
test.c:7: error: for each function it appears in.)