尝试构建示例代码时出现编译错误

I got compilation error when trying to build the example codes

我在cmake然后make之后遇到了这个错误。我已经安装了所有依赖项作为配置..谢谢

ME664JA-no-MacBook-Pro:examples ME664JA$ make
    [  0%] Built target all_examples
    [  1%] Building CXX object CMakeFiles/curl_fuse.dir/curl/curl_fuse.cpp.o
    In file included from /Users/ME664JA/Projects/actor-framework/examples/curl/curl_fuse.cpp:45:
    In file included from /usr/local/include/caf/all.hpp:25:
    In file included from /usr/local/include/caf/sec.hpp:27:
    In file included from /usr/local/include/caf/error.hpp:27:
    /usr/local/include/caf/fwd.hpp:111:12: error: ISO C++ forbids forward references to 'enum' types
    enum class atom_value : uint64_t;
               ^
    /usr/local/include/caf/fwd.hpp:111:23: error: expected unqualified-id
    enum class atom_value : uint64_t;
                          ^
    In file included from /Users/ME664JA/Projects/actor-framework/examples/curl/curl_fuse.cpp:45:
    In file included from /usr/local/include/caf/all.hpp:25:
    In file included from /usr/local/include/caf/sec.hpp:27:
    In file included from /usr/local/include/caf/error.hpp:28:
    In file included from /us`enter code here`r/local/include/caf/atom.hpp:27:
    /usr/local/include/caf/detail/atom_val.hpp:29:1: error: unknown type name 'constexpr'
    constexpr unsigned char encoding_table[] = {
    ^
    /usr/local/include/caf/detail/atom_val.hpp:29:11: error: expected unqualified-id
    constexpr unsigned char encoding_table[] = {

C++ Actor Framework 由 C++11 编写,将其中一行添加到您的 CMakeLists.txt:

set (CMAKE_CXX_STANDARD 14)

set (CMAKE_CXX_STANDARD 11)

这个例子适合我

project(projectCAF)
cmake_minimum_required(VERSION 3.6)

set(CMAKE_CXX_STANDARD 11)
set(CAF_INCLUDE_ALL /usr/local/include/caf)

include_directories(${CAF_INCLUDE_ALL})
link_directories(/usr/local/lib)


macro(add executable folder source)
  add_executable(${executable} ${folder}/${source}.cpp )

  target_link_libraries(${executable} "libcaf_core.so")
endmacro()

add(one . hello)