命名空间'std'中没有名为'make_unique'的成员

时间:2017-09-14 08:34:54

标签: ubuntu c++14 clang++

我正在使用cmake 3.9.2,我的CMakeLists.txt中有以下几行:

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall")

我也使用clang 4.0作为我的编译器,我的操作系统是Ubuntu Trusty。当我安装clang时,我添加了以下存储库:

deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-4.0 main
deb-src http://apt.llvm.org/trusty/ llvm-toolchain-trusty-4.0 main
ppa:ubuntu-toolchain-r/test

并运行命令:

# apt-get install clang-4.0 libstdc++6 libc++1

毕竟我还是得到了错误

error: no member named 'make_unique' in namespace 'std'

同时在我的OS X 10.11上,一切都在构建并顺利运行。在Ubuntu Zesty上我也没有任何问题。我在Ubuntu Trusty上做错了什么?

1 个答案:

答案 0 :(得分:1)

我似乎解决了这个问题。我需要安装applicationContext.xml并确保libc++-dev在命令行中。

相关问题