【发布时间】:2012-01-03 07:41:54
【问题描述】:
我安装了最新的 android ndk。我正在使用 Eclipse 和 Sequoyah。
我正在尝试使用应该在 stlport 或 gnustl 库中找到的各种东西,但我不断收到无法找到的错误。
在 JNI/Application.mk 我只有
APP_STL := stlport_shared
我已经尝试过 stlport_static 和 gnustl_static/shared 并且都得到了相同的结果。
在我的 Android.mk 中有
LIB_TEST_DIR := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_PATH := $(LIB_TEST_DIR)
LOCAL_MODULE := testmod
LOCAL_MODULE_FILENAME := libtestmod
LOCAL_CPP_EXTENSION := .cxx .cpp .cc
LOCAL_C_INCLUDES := $(LOCAL_PATH)/libtest2/
LOCAL_CFLAGS := -DHAVE_CONFIG_H
LOCAL_SRC_FILES := test.cc
include $(BUILD_SHARED_LIBRARY)
在 test.cc 包含的头文件中,我有
#include <cassert>
#include <algorithm>
#include <iosfwd>
但是,当我构建时,它找不到任何这些。知道我做错了什么吗?
当我进行清洁时,我会看到:
Clean: addiJNI [armeabi]
Clean: stlport_shared [armeabi]
Clean: stlport_static [armeabi]
所以,它似乎知道我想要 stlport。如果我改用 gnu 库,也会发生类似的事情。但是当我构建最简单的示例时,我会得到类似...
jni/test.cpp:4:19: error: cassert: No such file or directory
jni/test.cpp:6:21: error: algorithm: No such file or directory
jni/test.cpp:7:18: error: iosfwd: No such file or directory
make: *** [obj/local/armeabi/objs/addiJNI/addiJNI.o] Error 1
【问题讨论】:
-
我正在使用 Eclipse 和 Sequoyah。
-
呃,看错了,抱歉。您是否已将 stlport 的路径添加到项目的 C/C++ 选项中?
-
在路径和符号下->语言->GNU C++ 已经有这个 /home/corbin/applications/android-ndk/sources/cxx-stl/system/include 我添加了这个 /home/ corbin/applications/android-ndk/sources/cxx-stl/stlport/stlport 听起来对吗?如果我看那里,我会看到算法等。
标签: android c++ android-ndk makefile std