c:\libapiai-master\libapiai-master\build\examples>mingw32-make install
mingw32-make install
[ 5%] Built target indent_stream_library
[ 10%] Built target cJson
[ 12%] Building CXX object apiai/CMakeFiles/apiai.dir/src/AI.cpp.obj
C:\libapiai-master\libapiai-master\apiai\src\AI.cpp:1:0: warning: -fPIC ignored for target (all code is position independent) [enabled by default]
#include <apiai/AI.h>
^
C:\libapiai-master\libapiai-master\apiai\src\AI.cpp: In static member function 'static ai::Service& ai::AI::sharedService()':
C:\libapiai-master\libapiai-master\apiai\src\AI.cpp:42:12: error: 'once_flag' in namespace 'std' does not name a type
static std::once_flag once_flag;
^
C:\libapiai-master\libapiai-master\apiai\src\AI.cpp:45:5: error: 'call_once' is not a member of 'std'
std::call_once(once_flag, [](){
^
C:\libapiai-master\libapiai-master\apiai\src\AI.cpp:45:20: error: 'once_flag' was not declared in this scope
std::call_once(once_flag, [](){
^
apiai\CMakeFiles\apiai.dir\build.make:62: recipe for target 'apiai/CMakeFiles/apiai.dir/src/AI.cpp.obj' failed
mingw32-make[16]: *** [apiai/CMakeFiles/apiai.dir/src/AI.cpp.obj] Error 1
CMakeFiles\Makefile2:179: recipe for target 'apiai/CMakeFiles/apiai.dir/all' failed
mingw32-make[15]: *** [apiai/CMakeFiles/apiai.dir/all] Error 2
Makefile:137: recipe for target 'all' failed
mingw32-make[14]: *** [all] Error 2我构建了api.ai库。我用MinGW做到了这一点。我制作了Makefile,但我也犯了新的错误。有什么问题吗?
发布于 2016-09-28 07:45:59
MinGW (但不是MinGW-w64)目前不支持完整的pthread接口,包括std::once_flag。
您应该切换到MinGW-w64 (pthread支持)或使用Win32应用编程接口。此外,使用mingw-std-threads的MinGW可以支持部分线程。
发布于 2016-01-21 20:47:07
您没有传递-std=c++11标志。
发布于 2016-06-29 12:40:04
检查你的mingw版本,也许它不支持'once‘。或者可能'once‘包含在另一个头中。向github报告问题,我会尝试解决它。https://github.com/api-ai/libapiai
https://stackoverflow.com/questions/34924083
复制相似问题