我在通过cygwin在windows上编译pjsip时遇到了麻烦。 我试图使用pjsip形式的android branc http://svn.pjsip.org/repos/pjproject/branches/projects/android/ 适用于Windows的Android NDK r8c。
当我尝试配置pjsip时输出。
$ ./configure-android
configure-android: APP_PLATFORM not specified, using android-14
configure-android: TARGET_ABI not specified, using armeabi
configure-android: calling ./configure with env vars:
CC = /ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows/bin/arm-linux-androideabi-gcc
CXX = /ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows/bin/arm-linux-androideabi-g++
CFLAGS = -I/ndk/platforms/android-14/arch-arm/usr/include
CXXFLAGS = -shared --sysroot=/ndk/platforms/android-14/arch-arm
LDFLAGS = -nostdlib -L/ndk/platforms/android-14/arch-arm/usr/lib/
LIBS = -lc -lgcc
checking build system type... i686-pc-cygwin
checking host system type... arm-unknown-linux-androideabi
checking target system type... arm-unknown-linux-androideabi
checking for arm-linux-androideabi-gcc... /ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows/bin/arm-linux-androideabi-gcc
checking whether the C compiler works... no
aconfigure: error: in `/pjsip-android':
aconfigure: error: C compiler cannot create executables
See `config.log' for more details
这是摘自config.log
aconfigure:2490: result: /ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows/bin/arm-linux-androideabi-gcc
aconfigure:2759: checking for C compiler version
aconfigure:2768: c:\Development\cygwin\ndk\toolchains\arm-linux-androideabi-4.4.3\prebuilt\windows\bin\arm-linux-androideabi-gcc.exe --version >&5
./aconfigure: line 2770: /ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows/bin/arm-linux-androideabi-gcc: Permission denied
aconfigure:2779: $? = 126
aconfigure:2768: c:\Development\cygwin\ndk\toolchains\arm-linux-androideabi-4.4.3\prebuilt\windows\bin\arm-linux-androideabi-gcc.exe -v >&5
./aconfigure: line 2770: /ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows/bin/arm-linux-androideabi-gcc: Permission denied
aconfigure:2779: $? = 126
aconfigure:2768: c:\Development\cygwin\ndk\toolchains\arm-linux-androideabi-4.4.3\prebuilt\windows\bin\arm-linux-androideabi-gcc.exe -V >&5
./aconfigure: line 2770: /ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows/bin/arm-linux-androideabi-gcc: Permission denied
aconfigure:2779: $? = 126
aconfigure:2768: c:\Development\cygwin\ndk\toolchains\arm-linux-androideabi-4.4.3\prebuilt\windows\bin\arm-linux-androideabi-gcc.exe -qversion >&5
./aconfigure: line 2770: /ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows/bin/arm-linux-androideabi-gcc: Permission denied
aconfigure:2779: $? = 126
aconfigure:2799: checking whether the C compiler works
aconfigure:2821: /ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows/bin/arm-linux-androideabi-gcc -I/ndk/platforms/android-14/arch-arm/usr/include -I/ndk/platforms/android-14/arch-arm/usr/include -nostdlib -L/ndk/platforms/android-14/arch-arm/usr/lib/ conftest.c -lc -lgcc >&5
./aconfigure: line 2823: /ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows/bin/arm-linux-androideabi-gcc: Permission denied
aconfigure:2825: $? = 126
aconfigure:2863: result: no
任何人都可以告诉我该如何解决这个问题....
答案 0 :(得分:1)
确保你在Windows上启动Cygwin作为管理员,这让我在没有这么做的时候有点挣扎^^
答案 1 :(得分:0)
我设法克服了这个错误,但仍然没有设法编译pjsip。我切换到linux,所有的工作都应该...... [/ p>
答案 2 :(得分:0)
如果你看一下config.log,你会看到这样的东西:
aconfigure:2841: /cygdrive/c/android-ndk-r9/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows/bin/arm-linux-androideabi-gcc -I / cygdrive / c / android-ndk-r9 / platforms / android-18 / arch-arm / usr / include -I / cygdrive / c / android-ndk-r9 / platforms / android-18 / arch-arm / usr / include -nostdlib -L / cygdrive / c / android-ndk-r9 / platforms / android-18 / arch-arm / usr / lib / conftest.c -lc -lgcc>& 5
C:/android-ndk-r9/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows/bin /../ LIB / GCC /臂-Linux的androideabi / 4.4.3 /../ ../../../arm-linux-androideabi/bin/ld.exe:找不到-lc
NDK的ld.exe正在寻找libc(在arch-arm / usr / lib /中),但它不喜欢cygwin路径。更改 configure-android 行
export LDFLAGS =“$ {LDFLAGS} -nostdlib -L $ {ANDROID_SYSROOT} / usr / lib /”
这样的事情:
export LDFLAGS =“$ {LDFLAGS} -nostdlib -Lc:/机器人-NDK-R9 /平台/机器人-18 /拱形臂/ usr / lib中/“