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,但是我也犯了新的錯誤。 問題是什麼?mingw32-make錯誤,錯誤:名字空間'std'中的'once_flag'沒有命名一個類型
修改我接着說:add_compile_options(-std = C++ 11)'來CMakeLists。文本。 但我沒有工作。請幫幫我。 – user5819150
將它添加到'CMAKE_CXX_FLAGS',你可以通過-Dvarname = value將它傳遞給cmake。 – usr1234567
我發現它已經加入......我已經搜查了兩天的原因。但解決方案不存在... – user5819150