gpt4 book ai didi

android-ndk: stoi/stof/stod/to_string 不是 'std' 的成员

转载 作者:太空宇宙 更新时间:2023-11-03 13:46:03 24 4
gpt4 key购买 nike

我在 Ubuntu 14.04 64 位桌面上使用 android NDK 独立工具链 编译 mxnet(v0.9.3) 合并,但遇到了一些错误。第一个错误是:

arm-linux-androideabi-g++ -std=c++11 -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -fPIC -M -MT nnvm.o \
-I `pwd`/../ -I `pwd`/../include \
-D__MIN__=0 nnvm.cc > nnvm.d
arm-linux-androideabi-g++: error: unrecognized command line option '-msse2'

当我删除 '-msse2' 选项并再次运行 makefile 时,它可以编译更多但后来我遇到了像这样的新错误:

jni/../mxnet_predict-all.cc:2801:37: error: 'fopen64' was not declared in this scope
jni/../mxnet_predict-all.cc:21495:14: error: 'stoi' is not a member of 'std'
jni/../mxnet_predict-all.cc:30077:52: error: 'to_string' is not a member of 'std'
jni/../mxnet_predict-all.cc:34298:29: error: 'stof' is not a member of 'std'
jni/../mxnet_predict-all.cc:41383:56: error: 'stod' is not a member of 'std'
……

我应该怎么做才能解决这些问题?

顺便说一句:我的 android-ndk 版本是 android-ndk-r13b。要创建独立工具链,我遵循了这些步骤:
$ python NDK/build/tools/make_standalone_toolchain.py --arch arm --api 21 --install-dir/tmp/my-android-toolchain

export PATH=$PATH:/tmp/my-android-toolchain/bin
export CXX=arm-linux-androideabi-g++
export CC=arm-linux-androideabi-gcc

更多信息:https://github.com/dmlc/mxnet/issues/4888


我的 mxnet_predict-all.cc 的#includes:

#if defined(__MACH__)
#include <mach/clock.h>
#include <mach/mach.h>
#endif

#if !defined(__WIN32__)
#include <sys/stat.h>
#include <sys/types.h>

#if !defined(__ANDROID__) && (!defined(MSHADOW_USE_SSE) || MSHADOW_USE_SSE == 1)
#include <emmintrin.h>
#endif

#endif

#include <algorithm>
#include <array>
#include <assert.h>
#include <atomic>
#include <cblas.h>
#include <cctype>
#include <cfloat>
#include <chrono>
#include <climits>
#include <cmath>
#include <condition_variable>
#include <cstddef>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <dirent.h>
#include <errno.h>
#include <fstream>
#include <functional>
#include <inttypes.h>
#include <iostream>
#include <istream>
#include <limits>
#include <list>
#include <map>
#include <memory>
#include <mutex>
#include <new>
#include <ostream>
#include <queue>
#include <random>
#include <regex>
#include <sched.h>
#include <set>
#include <sstream>
#include <stdbool.h>
#include <stddef.h>
#include <stdexcept>
#include <stdint.h>
#include <stdlib.h>
#include <streambuf>
#include <string>
#include <thread>
#include <time.h>
#include <tuple>
#include <type_traits>
#include <typeindex>
#include <typeinfo>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

最佳答案

这似乎是 GNU STL 库的问题。我使用选项 '--STL=libc++' 重建了 android-toolchain 并成功编译。

关于android-ndk: stoi/stof/stod/to_string 不是 'std' 的成员,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42051279/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com