0

After attempting to compile Mesosphere's RENDLER in c++ with make all, I receive the following error:

$ make all
g++  -g -O2 -pthread -o rendler rendler.cpp -lmesos -lpthread -lprotobuf
In file included from /usr/local/include/stout/stringify.hpp:26:0,
                 from /usr/local/include/stout/bytes.hpp:26,
                 from /usr/local/include/mesos/resources.hpp:29,
                 from rendler.cpp:30:
/usr/local/include/stout/hashmap.hpp:43:32: error: expected ‘)’ before ‘<’ token
   hashmap(std::initializer_list<std::pair<Key, Value>> list)
                                ^
rendler.cpp:345:1: error: expected ‘}’ at end of input
 }
 ^
In file included from /usr/local/include/stout/stringify.hpp:26:0,
                 from /usr/local/include/stout/bytes.hpp:26,
                 from /usr/local/include/mesos/resources.hpp:29,
                 from rendler.cpp:30:
/usr/local/include/stout/hashmap.hpp:40:14: error: expected unqualified-id at end of input
   hashmap() {}
              ^
make: *** [rendler] Error 1

I have all of the listed dependencies installed as well as the relevant 3rd party libraries in the correct include path. I receive the same error when attempting to compile the example frameworks in the mesos/src/examples directory. What is causing this error?

1 Answers1

0

This piece of code

     std::initializer_list<std::pair<Key, Value>>
  // ^^^^^^^^^^^^^^^^^^^^^

causes the error

 error: expected ‘)’ before ‘<’ token

for pre stanadard c++11 compilers, since std::initializer_list was earliest introduced with c++11.

Most of the up-to date compilers like GCC allow to set the -std=c++11 option, which should fix your error.

πάντα ῥεῖ
  • 1
  • 13
  • 116
  • 190