c++编译报错解决

发布时间:2024年01月22日

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<float, kFftLengthBy2Plus1> 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<float, kFftLengthBy2Plus1> 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” ]

文章来源:https://blog.csdn.net/weixin_36623563/article/details/119733597
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。