saleyn / eixx

Erlang C++ Interface
Apache License 2.0
137 stars 26 forks source link

error: no matching member function for call to 'get' #36

Closed heri16 closed 3 years ago

heri16 commented 3 years ago

Environment:

How to reproduce:

brew install cmake boost openssl@1.1 doxygen
make distclean
env OPENSSL_ROOT_DIR=$(brew --prefix openssl) BOOST_ROOT=$(brew --prefix boost) make bootstrap toolchain=clang build=release prefix=/usr/local/opt verbose=true

Error:

/Users/heri/work/eixx/test/test_perf.cpp:23:30: error: use of undeclared identifier 'RUSAGE_THREAD'
    void begin() { getrusage(RUSAGE_THREAD, &start); }
                             ^
/Users/heri/work/eixx/test/test_perf.cpp:30:19: error: use of undeclared identifier 'RUSAGE_THREAD'
        getrusage(RUSAGE_THREAD, &end);
                  ^
2 errors generated.
make[3]: *** [test/CMakeFiles/test-perf.dir/test_perf.cpp.o] Error 1
make[2]: *** [test/CMakeFiles/test-perf.dir/all] Error 2
make[2]: *** Waiting for unfinished jobs....
/Users/heri/work/eixx/test/test_eterm.cpp:36:31: error: no matching member function for call to 'get'
    BOOST_REQUIRE_EQUAL(10, t.get<size_t>());
                            ~~^~~~~~~~~~~
/usr/local/Cellar/boost/1.76.0/include/boost/test/tools/old/interface.hpp:157:86: note: expanded from macro 'BOOST_REQUIRE_EQUAL'
    ::boost::test_tools::tt_detail::equal_impl_frwd(), "", REQUIRE, CHECK_EQUAL, (L)(R) )
                                                                                     ^
/usr/local/Cellar/boost/1.76.0/include/boost/test/tools/old/interface.hpp:74:61: note: expanded from macro 'BOOST_TEST_TOOL_IMPL'
        BOOST_JOIN( BOOST_TEST_TOOL_PASS_ARGS, frwd_type )( ARGS ) );           \
                                                            ^~~~
/usr/local/Cellar/boost/1.76.0/include/boost/test/tools/old/interface.hpp:57:57: note: expanded from macro 'BOOST_TEST_TOOL_PASS_ARGS0'
    BOOST_PP_SEQ_FOR_EACH( BOOST_TEST_TOOL_PASS_ARG, _, ARGS )
                                                        ^~~~
note: (skipping 20 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
/usr/local/Cellar/boost/1.76.0/include/boost/preprocessor/seq/elem.hpp:45:60: note: expanded from macro 'BOOST_PP_SEQ_ELEM_II'
#    define BOOST_PP_SEQ_ELEM_II(im) BOOST_PP_SEQ_ELEM_III(im)
                                                           ^~
/usr/local/Cellar/boost/1.76.0/include/boost/preprocessor/seq/elem.hpp:46:41: note: expanded from macro 'BOOST_PP_SEQ_ELEM_III'
#    define BOOST_PP_SEQ_ELEM_III(x, _) x
                                        ^
/usr/local/Cellar/boost/1.76.0/include/boost/test/tools/old/interface.hpp:53:49: note: expanded from macro 'BOOST_TEST_TOOL_PASS_ARG'
#define BOOST_TEST_TOOL_PASS_ARG( r, _, arg ) , arg, BOOST_STRINGIZE( arg )
                                                ^~~
/Users/heri/work/eixx/include/eixx/marshal/eterm.hpp:438:5: note: candidate template ignored: requirement
      'std::is_same<unsigned long, double>::value' was not satisfied [with T = unsigned long]
    get() const { return to_double(); }
    ^
/Users/heri/work/eixx/include/eixx/marshal/eterm.hpp:442:5: note: candidate template ignored: requirement
      'std::is_same<unsigned long, bool>::value' was not satisfied [with T = unsigned long]
    get() const { return to_bool(); }
    ^
/Users/heri/work/eixx/include/eixx/marshal/eterm.hpp:454:5: note: candidate template ignored: requirement 'std::is_same<unsigned long,
      char>::value || std::is_same<unsigned long, short>::value || std::is_same<unsigned long, int>::value || std::is_same<unsigned
      long, long>::value || std::is_same<unsigned long, unsigned char>::value || std::is_same<unsigned long, unsigned short>::value ||
      std::is_same<unsigned long, unsigned int>::value || std::is_same<unsigned long, unsigned long long>::value' was not satisfied
      [with T = unsigned long]
    get() const { return T(to_long()); }
    ^
/Users/heri/work/eixx/include/eixx/marshal/eterm.hpp:458:5: note: candidate template ignored: requirement 'std::is_same<unsigned long,
      std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value' was not satisfied
      [with T = unsigned long]
    get() const { return to_str().to_str(); }
    ^
1 error generated.
make[3]: *** [test/CMakeFiles/test-eterm.dir/test_eterm.cpp.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [test/CMakeFiles/test-eterm.dir/all] Error 2
make[1]: *** [all] Error 2
make: *** [all] Error 2
heri16 commented 3 years ago

Is there support for clang? The README is unclear on this.

saleyn commented 3 years ago

The project was only tested on Linux. Possibly some ifdefs are needed for MacOS. Patches are welcome.

heri16 commented 3 years ago

Is clang/llvm supported on Linux?

saleyn commented 3 years ago

Yes:

$ make bootstrap toolchain=clang
$ make