c++cmakec++-actor-framework

I got compilation error when trying to build the example codes


I have encountered this error after cmake then make. I have installed all dependencies as configuration..thanks

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[] = {

Solution

  • C++ Actor Framework is written by C++11, Add one of those line to your CMakeLists.txt:

    set (CMAKE_CXX_STANDARD 14)
    

    or

    set (CMAKE_CXX_STANDARD 11)