3

我在通过 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

谁能告诉我如何解决这个问题......

4

3 回答 3

1

确保您在 Windows 上以管理员身份启动 Cygwin,如果不这样做,我会很挣扎^^

于 2012-12-21T08:46:45.617 回答
0

我设法克服了那个错误,但仍然没有设法编译 pjsip。我切换到linux,一切正常......

于 2012-12-30T13:58:00.813 回答
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/arm-linux-androideabi/4.4.3/../../ ../../arm-linux-androideabi/bin/ld.exe:找不到-lc

NDK 的 ld.exe 正在寻找 libc(位于 arch-arm/usr/lib/ 中),但它不喜欢 cygwin 路径。在configure-android改行

导出 LDFLAGS="${LDFLAGS} -nostdlib -L${ANDROID_SYSROOT}/usr/lib/"

像这样:

导出 LDFLAGS="${LDFLAGS} -nostdlib -Lc:/android-ndk-r9/platforms/android-18/arch-arm/usr/lib/"

于 2013-08-05T18:19:57.600 回答