【问题标题】:Compiling stressapptest on NDK for Android在 NDK for Android 上编译 stressapptest
【发布时间】:2018-09-25 22:41:44
【问题描述】:

我目前正在尝试使用 NDK 环境编译压力应用程序测试(链接:https://github.com/stressapptest/stressapptest),出于某种原因,我遇到了困难。这些是我采取的步骤:

  1. 将存储库克隆到我的计算机上
  2. 添加了一个 jni 文件夹并将所有文件移入其中
  3. 创建了一个 Application.mk 文件
  4. 从我的 jni 文件夹位置打开 PowerShell 并执行 ndk-build。这是我得到的错误:

    PS C:\Users\...\Desktop\stressapptest-master\stressapptest-master> ndk-build    
    Android NDK: APP_PLATFORM not set. Defaulting to minimum supported version android-16.    
    [arm64-v8a] Compile++      : stressapptest <= main.cc
    In file included from jni/src/main.cc:17:
    jni/src/sattypes.h:25:10: fatal error: 'algorithm' file not found        
    #include <algorithm>
             ^~~~~~~~~~~
    1 error generated.
    make: *** [obj/local/arm64-v8a/objs/stressapptest/src/main.o] Error 1
    

我还需要什么其他东西才能编译它以在 Android 系统上运行吗?

【问题讨论】:

    标签: android android-ndk ndk-build


    【解决方案1】:

    在 Application.mk 中将 APP_STL 设置为 c++_shared。 ndk-build 默认不使用任何 STL。

    【讨论】:

    • 我昨晚下班前就已经想通了。我按照你这里说的做了,同时将APP_ABI设置为armeabi-v7a。
    • 所以这有效还是无效?如果它有效,您应该将其标记为正确答案。
    猜你喜欢
    • 1970-01-01
    • 2011-07-15
    • 2017-03-02
    • 2012-06-08
    • 2020-04-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多