c++编译报错解决

1. std::array<>初始化

In file included from …/…/…/modules/audio_processing/aec3/dt_control.cc:11:0:
…/…/…/modules/audio_processing/aec3/dt_control.h:139:52: error: array must be initialized with a brace-enclosed initializer
std::array cohde_ = {0};
^

gcc 5.4.0 does not accept a = {} initialization for std::array.
g++ 7.5.0支持

解决办法:
更兼容的写法:
More C++11 compliant solution is:
std::array cohde_ = {{0}};

2. ‘powf’ is not a member of ‘std’

Up until C++11, powf was just a Microsoft-ism.
Since C++11, powf does appear in the ISO standard and is part of the std namespace.
For std::powf, gcc libstdc++ is not compliant while clang libc++ is.
gcc 没有实现std::powf, 用std::pow替代

3. error: inlining failed in call to always_inline ‘__m128i _mm_shuffle_epi8(__m128i, __m128i)’: target specific option mismatch

cflags += [“-msse4” ]

你可能感兴趣的:(c++,开发语言)