包括错误与pjsip作为静态库在Android NDK项目

Include errors with pjsip as static library in Android NDK project

本文关键字:Android NDK 项目 静态 错误 pjsip 包括      更新时间:2023-10-16

基于这两个库的例子,我构建了一个pjsip作为静态库。到目前为止一切顺利。但是当我仅仅从库中包含一个文件到库外的文件时,我得到了许多错误。

编辑:这是一个Eclipse项目,使用Android.mk我试着添加到Android.mk:
FILE_LIST_H := $(filter %.h*, $(ALLFILES))
LOCAL_C_INCLUDES := $(FILE_LIST_H:$(LOCAL_PATH)/%=%)

Demo.cpp:

#include <jni.h>
#include <pjsip/include/pjsua-lib/pjsua.h>

输出

Compile++ thumb: Demo <= Demo.cpp

从C:/workspace/Demo/jni/Demo.cpp:3:

pjsup .h:30:19: error: pjsup .h: No such file or directory

pjsua.h:33:21: error: pjmedia.h: No such file or directory

pjsua.h:36:27: error: pjmedia-codec.h: No such file or directory

它是这样的…

请建议,10XS,

Nir

使用-I<location of the pjsip include folder>将pjsip include目录添加到编译器调用中。由于您没有提到您是使用IDE还是仅仅使用makefile,因此很难给出更具体的建议。如果您使用的是Android .mk文件,请添加LOCAL_C_INCLUDES:=<path to your pjsip include folder>