在centos

时间:2018-01-15 06:06:22

标签: android c linux android-ndk pjsip

我正在尝试将pjSip用于我的Android应用程序并遵循pjsip指令。我的系统配置是centos 7.4 64 bit。     我已经下载了最新的ndk和pjsip代码。     但是当我运行命令时,我遇到了错误。 还有一点我注意到了,confige.log aslo显示 cc1:警告:命令行选项' -frtti'适用于C ++ / ObjC ++但不适用于C

[root@localhost pjproject-2.7.1]# ./configure-android

configure-android: APP_PLATFORM not specified, using android-27
configure-android: TARGET_ABI not specified, using armeabi
configure-android: calling ./configure with env vars:
 CC = /root/ROOTSIPFOLDER/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc
 CXX = /root/ROOTSIPFOLDER/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++
 CFLAGS =  --sysroot=/root/ROOTSIPFOLDER/android-ndk-r16b/platforms/android-27/arch-arm -I/root/ROOTSIPFOLDER/android-ndk-r16b/sources/cxx-stl/gnu-libstdc++/4.9/include -I/root/ROOTSIPFOLDER/android-ndk-r16b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/include
 CXXFLAGS =  -shared --sysroot=/root/ROOTSIPFOLDER/android-ndk-r16b/platforms/android-27/arch-arm -fexceptions -frtti
 LDFLAGS =  --sysroot=/root/ROOTSIPFOLDER/android-ndk-r16b/platforms/android-27/arch-arm -L/root/ROOTSIPFOLDER/android-ndk-r16b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/
 LIBS = -lgnustl_static  -lc -lgcc
 AR = /root/ROOTSIPFOLDER/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ar
 RANLIB = /root/ROOTSIPFOLDER/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ranlib
 TARGET_HOST = arm-linux-androideabi
 TARGET_ABI = armeabi
checking build system type... x86_64-unknown-linux-gnu
checking host system type... arm-unknown-linux-androideabi
checking target system type... arm-unknown-linux-androideabi
checking for arm-linux-androideabi-gcc... /root/ROOTSIPFOLDER/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /root/ROOTSIPFOLDER/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc accepts -g... yes
checking for /root/ROOTSIPFOLDER/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc option to accept ISO C89... unsupported
checking whether we are using the GNU C++ compiler... yes
checking whether /root/ROOTSIPFOLDER/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ accepts -g... yes
checking for arm-linux-androideabi-ranlib... /root/ROOTSIPFOLDER/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ranlib
checking for arm-linux-androideabi-ar... /root/ROOTSIPFOLDER/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ar
checking for pthread_create in -lpthread... no
checking for puts in -lwsock32... no
checking for puts in -lws2_32... no
checking for puts in -lole32... no
checking for puts in -lwinmm... no
checking for puts in -lsocket... no
checking for puts in -lrt... no
checking for sin in -lm... yes
checking for uuid_generate in -luuid... no
checking for uuid_generate in -luuid... (cached) no
checking for library containing gethostbyname... none required
Setting PJ_M_NAME to arm
checking memory alignment... 4 bytes (default)
checking how to run the C preprocessor... /lib/cpp
aconfigure: error: in `/root/ROOTSIPFOLDER/pjproject-2.7.1':
aconfigure: error: C preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details

Below is my configue.log result.



    aconfigure:2916: /root/ROOTSIPFOLDER/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc -v >&5
Using built-in specs.
COLLECT_GCC=/root/ROOTSIPFOLDER/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc
COLLECT_LTO_WRAPPER=/root/ROOTSIPFOLDER/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../libexec/gcc/arm-linux-androideabi/4.9.x/lto-wrapper
Target: arm-linux-androideabi
.......................................
aconfigure:3269: /root/ROOTSIPFOLDER/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc -c -g  --sysroot=/root/ROOTSIPFOLDER/android-ndk-r16b/platforms/android-27/arch-arm -fexceptions -frtti conftest.c >&5
cc1: warning: command line option '-frtti' is valid for C++/ObjC++ but not for C
aconfigure:3269: $? = 0
aconfigure:3279: result: yes
aconfigure:3296: checking for /root/ROOTSIPFOLDER/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc option to accept ISO C89
aconfigure:3359: /root/ROOTSIPFOLDER/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc  -c  --sysroot=/root/ROOTSIPFOLDER/android-ndk-r16b/platforms/android-27/arch-arm -I/root/ROOTSIPFOLDER/android-ndk-r16b/sources/cxx-stl/gnu-libstdc++/4.9/include -I/root/ROOTSIPFOLDER/android-ndk-r16b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/include  --sysroot=/root/ROOTSIPFOLDER/android-ndk-r16b/platforms/android-27/arch-arm -fexceptions -frtti conftest.c >&5
cc1: warning: command line option '-frtti' is valid for C++/ObjC++ but not for C
conftest.c:10:19: fatal error: stdio.h: No such file or directory
 #include <stdio.h>
                   ^
compilation terminated.
aconfigure:3359: $? = 1
aconfigure: failed program was:
 /* confdefs.h */
 #define PACKAGE_NAME "pjproject"
 #define PACKAGE_TARNAME "pjproject"
 #define PACKAGE_VERSION "2.x"
 #define PACKAGE_STRING "pjproject 2.x"
 #define PACKAGE_BUGREPORT ""
 #define PACKAGE_URL ""
 /* end confdefs.h.  */
 #include <stdarg.h>
 #include <stdio.h>
 struct stat;
 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
 struct buf { int x; };
 FILE * (*rcsopen) (struct buf *, struct stat *, int);
 static char *e (p, i)
      char **p;
      int i;
 {
  return p[i];
 }
 static char *f (char * (*g) (char **, int), char **p, ...)
 {
  char *s;
   va_list v;
   va_start (v,p);
   s = g (p, va_arg (v,int));
   va_end (v);
  return s;
 }

arm-linux-androideabi-gcc: error: unrecognized command line option '-std'
aconfigure:3359: $? = 1
aconfigure: failed program was:
 /* confdefs.h */
 #define PACKAGE_NAME "pjproject"
 #define PACKAGE_TARNAME "pjproject"
 #define PACKAGE_VERSION "2.x"
 #define PACKAGE_STRING "pjproject 2.x"
 #define PACKAGE_BUGREPORT ""
 #define PACKAGE_URL ""
/* end confdefs.h.  */
 #include <stdarg.h>
 #include <stdio.h>
 struct stat;
 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
 struct buf { int x; };
 FILE * (*rcsopen) (struct buf *, struct stat *, int);
 static char *e (p, i)
      char **p;
      int i;
{
   return p[i];
 }Satic char *f (char * (*g) (char **, int), char **p, ...)
 {
   char *s;
   va_list v;
   va_start (v,p);
   s = g (p, va_arg (v,int));
   va_end (v);
   return s;
 }
* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
    function prototypes and stuff, but not '\xHH' hex character constants.
    These don't provoke an error unfortunately, instead are silently treated
    as 'x'.  The following induces an error, until -std is added to get
    proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
    array size at least.  It's necessary to write '\x00'==0 to get something
    that's true only with -std.  */
 int osf4_cc_array ['\x00' == 0 ? 1 : -1];

 /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
    inside strings and character constants.  */
 #define FOO(x) 'x'
 int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];

 int test (int i, double x);
 struct s1 {int (*f) (int a);};
 struct s2 {int (*f) (double a);};
 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
 int argc;
 char **argv;
 int
 main ()
 {
 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
   ;
   return 0;
 }
aconfigure:3359: /root/ROOTSIPFOLDER/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc -Ae -c  --sysroot=/root/ROOTSIPFOLDER/android-ndk-r16b/platforms/android-27/arch-arm -I/root/ROOTSIPFOLDER/android-ndk-r16b/sources/cxx-stl/gnu-libstdc++/4.9/include -I/root/ROOTSIPFOLDER/android-ndk-r16b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/include  --sysroot=/root/ROOTSIPFOLDER/android-ndk-r16b/platforms/android-27/arch-arm -fexceptions -frtti conftest.c >&5
cc1: warning: command line option '-frtti' is valid for C++/ObjC++ but not for C
<command-line>:0:1: error: missing '(' after predicate
conftest.c:10:19: fatal error: stdio.h: No such file or directory
 #include <stdio.h>
                   ^
compilation terminated.
aconfigure:3359: $? = 1
aconfigure: failed program was:
 /* confdefs.h */
 #define PACKAGE_NAME "pjproject"
 #define PACKAGE_TARNAME "pjproject"
 #define PACKAGE_VERSION "2.x"
 #define PACKAGE_STRING "pjproject 2.x"
 #define PACKAGE_BUGREPORT ""
 #define PACKAGE_URL ""
 /* end confdefs.h.  */
 #include <stdarg.h>
 #include <stdio.h>
 struct stat;
 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
 struct buf { int x; };
 FILE * (*rcsopen) (struct buf *, struct stat *, int);
 static char *e (p, i)
      char **p;
      int i;
 {
   return p[i];
 }
| static char *f (char * (*g) (char **, int), char **p, ...)
 {
   char *s;
   va_list v;
   va_start (v,p);
   s = g (p, va_arg (v,int));
   va_end (v);
   return s;
 }

/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
    function prototypes and stuff, but not '\xHH' hex character constants.
    These don't provoke an error unfortunately, instead are silently treated
    as 'x'.  The following induces an error, until -std is added to get
    proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
    array size at least.  It's necessary to write '\x00'==0 to get something
    that's true only with -std.  */
 int osf4_cc_array ['\x00' == 0 ? 1 : -1];

 /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
    inside strings and character constants.  */
 #define FOO(x) 'x'
 int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];

 int test (int i, double x);
 struct s1 {int (*f) (int a);};
 struct s2 {int (*f) (double a);};
 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
 int argc;
 char **argv;
 int
 main ()
 {
 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
   ;
   return 0;
 }
aconfigure:3359: /root/ROOTSIPFOLDER/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc -Aa -D_HPUX_SOURCE -c  --sysroot=/root/ROOTSIPFOLDER/android-ndk-r16b/platforms/android-27/arch-arm -I/root/ROOTSIPFOLDER/android-ndk-r16b/sources/cxx-stl/gnu-libstdc++/4.9/include -I/root/ROOTSIPFOLDER/android-ndk-r16b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/include  --sysroot=/root/ROOTSIPFOLDER/android-ndk-r16b/platforms/android-27/arch-arm -fexceptions -frtti conftest.c >&5
cc1: warning: command line option '-frtti' is valid for C++/ObjC++ but not for C
<command-line>:0:1: error: missing '(' after predicate
conftest.c:10:19: fatal error: stdio.h: No such file or directory
 #include <stdio.h>
                   ^
compilation terminated.
aconfigure:3359: $? = 1
aconfigure: failed program was:
 /* confdefs.h */
 #define PACKAGE_NAME "pjproject"
 #define PACKAGE_TARNAME "pjproject"
 #define PACKAGE_VERSION "2.x"
#define PACKAGE_BUGREPORT ""
 #define PACKAGE_URL ""
 /* end confdefs.h.  */
 #include <stdarg.h>
 #include <stdio.h>
 struct stat;
 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
 struct buf { int x; };
 FILE * (*rcsopen) (struct buf *, struct stat *, int);
 static char *e (p, i)
      char **p;
      int i;
 {
   return p[i];
 }
 static char *f (char * (*g) (char **, int), char **p, ...)
 {
   char *s;
   va_list v;
   va_start (v,p);
   s = g (p, va_arg (v,int));
   va_end (v);
   return s;
 }
|              Syntax error
aconfigure:4534: /lib/cpp  --sysroot=/root/ROOTSIPFOLDER/android-ndk-r16b/platforms/android-27/arch-arm -fexceptions -frtti conftest.c
cc1: warning: command line option '-frtti' is valid for C++/ObjC++ but not for C [enabled by default]
In file included from /usr/lib/gcc/x86_64-redhat-linux/4.8.5/include/syslimits.h:7:0,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.8.5/include/limits.h:34,
                 from conftest.c:13:
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/include/limits.h:168:61: error: no include path in which to search for limits.h
 #include_next <limits.h>  /* recurse down to the real one */
                                                             ^
aconfigure:4534: $? = 1
aconfigure: failed program was:
 /* confdefs.h */
  #define PACKAGE_NAME "pjproject"
 #define PACKAGE_TARNAME "pjproject"
#define PACKAGE_VERSION "2.x"
 #define PACKAGE_STRING "pjproject 2.x"
 #define PACKAGE_BUGREPORT ""
 #define PACKAGE_URL ""
#define HAVE_LIBM 1
 #define PJ_M_NAME "arm"
 #define PJ_POOL_ALIGNMENT 4
 /* end confdefs.h.  */
 #ifdef __STDC__
 # include <limits.h>
 #else
 # include <assert.h>
 #endif
           Syntax error
aconfigure:4564: error: in `/root/ROOTSIPFOLDER/pjproject-2.7.1':
aconfigure:4566: error: C preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details

上面的错误没有在任何地方解决,我已经尝试了他们的所有事情 建议。
 我非常小心地遵循每一步,现在不知道我做错了什么。我在centos 6.9上尝试过相同但没有成功。最初我在sygwin的Windows上尝试了同样的东西,但我也无法运行。 我想知道我的机器有问题,或者我做错了什么        对不起,我无法格式化日志。希望我能在这里得到一些帮助。

1 个答案:

答案 0 :(得分:0)

看起来项目的构建脚本是一些过时的修订:https://github.com/pjsip/pjproject/blob/master/configure-android#L180。标头移动到r14中的合并树(而不是per-API和per-arch),并且在r16中删除了已弃用的标头。

您可能想尝试使用standalone toolchain进行构建。您可能想尝试首先使用非Android配置脚本中的一个(独立工具链被设计为放入任意不支持Android的任意autoconf系统),但如果这不起作用那么尝试使用configure-android。