标签: android-stlport

仅限标头的C++库(GLM)无法使用Android-NDK进行编译

我想在Android NDK项目中使用GLM(glm.g-truc.net)仅头文件的C++库,但是我遇到了编译错误.在Android.mk,我添加了标题搜索路径

LOCAL_CFLAGS += -I/Users/Johannes/Development/glm_include/
Run Code Online (Sandbox Code Playgroud)

我也尝试使用STLport和GNU-STL进行编译,方法Application.mk是在CPLUSPLUS-SUPPORT文档中描述如下:

APP_STL := stlport_static
Run Code Online (Sandbox Code Playgroud)

要么

APP_STL := gnustl_static
Run Code Online (Sandbox Code Playgroud)

分别.没有任何帮助; 这些是我在包含<glm/glm.h>和使用时遇到的错误glm::ivec2.ndk-build输出:

Compile++ arm    : wbar <= QCARBase.cpp
In file included from /Users/Johannes/Development/glm_include/glm/glm.hpp:66,
                 from /Users/Johannes/proj/WirtschaftsblattAR/app/android/wbar/jni/QCARBase.cpp:45:
/Users/Johannes/Development/glm_include/glm/./core/func_common.hpp:240: error: expected unqualified-id before 'sizeof'
/Users/Johannes/Development/glm_include/glm/./core/func_common.hpp:240: error: expected ')' before 'sizeof'
/Users/Johannes/Development/glm_include/glm/./core/func_common.hpp:240: error: expected ')' before 'sizeof'
/Users/Johannes/Development/glm_include/glm/./core/func_common.hpp:251: error: expected unqualified-id before 'sizeof'
/Users/Johannes/Development/glm_include/glm/./core/func_common.hpp:251: error: expected ')' before 'sizeof'
/Users/Johannes/Development/glm_include/glm/./core/func_common.hpp:251: error: expected ')' before 'sizeof'
In file included from …
Run Code Online (Sandbox Code Playgroud)

c++ stl android-ndk android-stlport

5
推荐指数
1
解决办法
4229
查看次数

如何判断 Android .so 是使用哪个运行时编译的?

我有一些预编译的 so 文件,所以谁知道使用什么标志来生成它们。我很想知道它们是用哪个运行时/版本的 STL 编译的(gnustl_shared?stlport_shared?)以避免与我自己的代码发生冲突。

如何从编译后的 so 文件中找出它们编译使用的运行时?

这是所有 Android NDK C++ 代码。

android runtime android-ndk android-stlport

3
推荐指数
1
解决办法
2049
查看次数

崩溃初始化std :: String

虽然Android-NDK(Android的JNI)我试图使用STL使其更容易使用字符串.

以下代码在执行时崩溃:

    __android_log_print(ANDROID_LOG_DEBUG, "RMSDK:RMServices", "[%s]", "Converting");
    std::string str("mark");
    __android_log_print(ANDROID_LOG_DEBUG, "RMSDK:RMServices", "[%s]", str);
Run Code Online (Sandbox Code Playgroud)

执行时,将打印以下堆栈.

DEBUG/RMSDK:RMServices(11786): [Converting]
INFO/DEBUG(31): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
INFO/DEBUG(31): Build fingerprint: 'generic/sdk/generic/:2.2/FRF91/43546:eng/test-keys'
INFO/DEBUG(31): pid: 11786, tid: 11786  >>> br.com.iba <<<
INFO/DEBUG(31): signal 11 (SIGSEGV), fault addr deadbaad
INFO/DEBUG(31):  r0 00000000  r1 00000000  r2 00000027  r3 00000000
INFO/DEBUG(31):  r4 00000000  r5 deadbaad  r6 00001728  r7 4618bd80
INFO/DEBUG(31):  r8 00261938  r9 002a5df0  10 00000000  fp 00000000
INFO/DEBUG(31):  ip …
Run Code Online (Sandbox Code Playgroud)

java-native-interface android android-ndk android-stlport

2
推荐指数
1
解决办法
2737
查看次数