pezmaster31/bamtools

compilation error of "bamtools_filter.cpp.o"

mtajhuss opened this issue · 6 comments

I am trying to install the BamTools on Mac Catalina. During the make compilation I have the following error:
mtajhusl@Drs-MacBook-Pro build % sudo make Password: [ 66%] Built target BamTools [ 74%] Built target BamTools-utils [ 76%] Building CXX object src/toolkit/CMakeFiles/bamtools_cmd.dir/bamtools_filter.cpp.o In file included from /Users/tajammul/Documents/packages/bamtools/src/toolkit/bamtools_filter.cpp:19: In file included from /usr/local/Cellar/jsoncpp/1.9.1/include/json/json.h:9: In file included from /usr/local/Cellar/jsoncpp/1.9.1/include/json/autolink.h:9: In file included from /usr/local/Cellar/jsoncpp/1.9.1/include/json/config.h:132: /usr/local/Cellar/jsoncpp/1.9.1/include/json/allocator.h:18:22: warning: alias declarations are a C++11 extension [-Wc++11-extensions] using value_type = T; ^ /usr/local/Cellar/jsoncpp/1.9.1/include/json/allocator.h:19:19: warning: alias declarations are a C++11 extension [-Wc++11-extensions] using pointer = T*; ^ /usr/local/Cellar/jsoncpp/1.9.1/include/json/allocator.h:20:25: warning: alias declarations are a C++11 extension [-Wc++11-extensions] using const_pointer = const T*; ^ /usr/local/Cellar/jsoncpp/1.9.1/include/json/allocator.h:21:21: warning: alias declarations are a C++11 extension [-Wc++11-extensions] using reference = T&; ^ /usr/local/Cellar/jsoncpp/1.9.1/include/json/allocator.h:22:27: warning: alias declarations are a C++11 extension [-Wc++11-extensions] using const_reference = const T&; ^ /usr/local/Cellar/jsoncpp/1.9.1/include/json/allocator.h:23:21: warning: alias declarations are a C++11 extension [-Wc++11-extensions] using size_type = std::size_t; ^ /usr/local/Cellar/jsoncpp/1.9.1/include/json/allocator.h:24:27: warning: alias declarations are a C++11 extension [-Wc++11-extensions] using difference_type = std::ptrdiff_t; ^ /usr/local/Cellar/jsoncpp/1.9.1/include/json/allocator.h:50:21: warning: variadic templates are a C++11 extension [-Wc++11-extensions] template <typename... Args> void construct(pointer p, Args&&... args) { ^ /usr/local/Cellar/jsoncpp/1.9.1/include/json/allocator.h:50:61: warning: rvalue references are a C++11 extension [-Wc++11-extensions] template <typename... Args> void construct(pointer p, Args&&... args) { ^ /usr/local/Cellar/jsoncpp/1.9.1/include/json/allocator.h:72:55: warning: alias declarations are a C++11 extension [-Wc++11-extensions] template <typename U> struct rebind { using other = SecureAllocator<U>; }; ^ In file included from /Users/tajammul/Documents/packages/bamtools/src/toolkit/bamtools_filter.cpp:19: In file included from /usr/local/Cellar/jsoncpp/1.9.1/include/json/json.h:9: In file included from /usr/local/Cellar/jsoncpp/1.9.1/include/json/autolink.h:9: /usr/local/Cellar/jsoncpp/1.9.1/include/json/config.h:159:19: warning: alias declarations are a C++11 extension [-Wc++11-extensions] using Allocator = typename std::conditional<JSONCPP_USING_SECURE_MEMORY, ^ /usr/local/Cellar/jsoncpp/1.9.1/include/json/config.h:161:61: error: a space is required between consecutive right angle brackets (use '> >') std::allocator<T>>::type; ^~ > > /usr/local/Cellar/jsoncpp/1.9.1/include/json/config.h:162:16: warning: alias declarations are a C++11 extension [-Wc++11-extensions] using String = std::basic_string<char, std::char_traits<char>, Allocator<char>>; ^ /usr/local/Cellar/jsoncpp/1.9.1/include/json/config.h:162:78: error: a space is required between consecutive right angle brackets (use '> >') using String = std::basic_string<char, std::char_traits<char>, Allocator<char>>; ^~ > > /usr/local/Cellar/jsoncpp/1.9.1/include/json/config.h:163:23: warning: alias declarations are a C++11 extension [-Wc++11-extensions] using IStringStream = std::basic_istringstream<String::value_type, ^ /usr/local/Cellar/jsoncpp/1.9.1/include/json/config.h:166:23: warning: alias declarations are a C++11 extension [-Wc++11-extensions] using OStringStream = std::basic_ostringstream<String::value_type, ^ /usr/local/Cellar/jsoncpp/1.9.1/include/json/config.h:169:17: warning: alias declarations are a C++11 extension [-Wc++11-extensions] using IStream = std::istream; ^ /usr/local/Cellar/jsoncpp/1.9.1/include/json/config.h:170:17: warning: alias declarations are a C++11 extension [-Wc++11-extensions] using OStream = std::ostream; ^ /usr/local/Cellar/jsoncpp/1.9.1/include/json/config.h:174:24: warning: alias declarations are a C++11 extension [-Wc++11-extensions] using JSONCPP_STRING = Json::String; ^ /usr/local/Cellar/jsoncpp/1.9.1/include/json/config.h:175:31: warning: alias declarations are a C++11 extension [-Wc++11-extensions] using JSONCPP_ISTRINGSTREAM = Json::IStringStream; ^ /usr/local/Cellar/jsoncpp/1.9.1/include/json/config.h:176:31: warning: alias declarations are a C++11 extension [-Wc++11-extensions] using JSONCPP_OSTRINGSTREAM = Json::OStringStream; ^ /usr/local/Cellar/jsoncpp/1.9.1/include/json/config.h:177:25: warning: alias declarations are a C++11 extension [-Wc++11-extensions] using JSONCPP_ISTREAM = Json::IStream; ^ /usr/local/Cellar/jsoncpp/1.9.1/include/json/config.h:178:25: warning: alias declarations are a C++11 extension [-Wc++11-extensions] using JSONCPP_OSTREAM = Json::OStream; ^ In file included from /Users/tajammul/Documents/packages/bamtools/src/toolkit/bamtools_filter.cpp:19: In file included from /usr/local/Cellar/jsoncpp/1.9.1/include/json/json.h:10: /usr/local/Cellar/jsoncpp/1.9.1/include/json/features.h:44:8: error: function definition does not declare parameters bool allowComments_{true}; ^ /usr/local/Cellar/jsoncpp/1.9.1/include/json/features.h:48:8: error: function definition does not declare parameters bool strictRoot_{false}; ^ /usr/local/Cellar/jsoncpp/1.9.1/include/json/features.h:51:8: error: function definition does not declare parameters bool allowDroppedNullPlaceholders_{false}; ^ /usr/local/Cellar/jsoncpp/1.9.1/include/json/features.h:54:8: error: function definition does not declare parameters bool allowNumericKeys_{false}; ^ In file included from /Users/tajammul/Documents/packages/bamtools/src/toolkit/bamtools_filter.cpp:19: In file included from /usr/local/Cellar/jsoncpp/1.9.1/include/json/json.h:11: In file included from /usr/local/Cellar/jsoncpp/1.9.1/include/json/reader.h:11: /usr/local/Cellar/jsoncpp/1.9.1/include/json/value.h:48:33: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] ~Exception() JSONCPP_NOEXCEPT override; ^ /usr/local/Cellar/jsoncpp/1.9.1/include/json/value.h:49:45: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] char const* what() const JSONCPP_NOEXCEPT override; ^ /usr/local/Cellar/jsoncpp/1.9.1/include/json/value.h:79:2: error: expected expression [[noreturn]] void throwRuntimeError(String const& msg); ^ /usr/local/Cellar/jsoncpp/1.9.1/include/json/value.h:79:14: error: expected unqualified-id [[noreturn]] void throwRuntimeError(String const& msg); ^ /usr/local/Cellar/jsoncpp/1.9.1/include/json/value.h:81:2: error: expected expression [[noreturn]] void throwLogicError(String const& msg); ^ /usr/local/Cellar/jsoncpp/1.9.1/include/json/value.h:81:14: error: expected unqualified-id [[noreturn]] void throwLogicError(String const& msg); ^ /usr/local/Cellar/jsoncpp/1.9.1/include/json/value.h:246:22: warning: rvalue references are a C++11 extension [-Wc++11-extensions] CZString(CZString&& other); ^ /usr/local/Cellar/jsoncpp/1.9.1/include/json/value.h:249:33: warning: rvalue references are a C++11 extension [-Wc++11-extensions] CZString& operator=(CZString&& other); ^ /usr/local/Cellar/jsoncpp/1.9.1/include/json/value.h:331:14: warning: rvalue references are a C++11 extension [-Wc++11-extensions] Value(Value&& other); ^ /usr/local/Cellar/jsoncpp/1.9.1/include/json/value.h:337:25: warning: rvalue references are a C++11 extension [-Wc++11-extensions] Value& operator=(Value&& other); ^ /usr/local/Cellar/jsoncpp/1.9.1/include/json/value.h:458:22: warning: rvalue references are a C++11 extension [-Wc++11-extensions] Value& append(Value&& value); ^ /usr/local/Cellar/jsoncpp/1.9.1/include/json/value.h:646:18: warning: defaulted function definitions are a C++11 extension [-Wc++11-extensions] Comments() = default; ^ /usr/local/Cellar/jsoncpp/1.9.1/include/json/value.h:648:22: warning: rvalue references are a C++11 extension [-Wc++11-extensions] Comments(Comments&& that); ^ /usr/local/Cellar/jsoncpp/1.9.1/include/json/value.h:650:33: warning: rvalue references are a C++11 extension [-Wc++11-extensions] Comments& operator=(Comments&& that); ^ /usr/local/Cellar/jsoncpp/1.9.1/include/json/value.h:656:19: warning: alias declarations are a C++11 extension [-Wc++11-extensions] using Array = std::array<String, numberOfCommentPlacement>; ^ /usr/local/Cellar/jsoncpp/1.9.1/include/json/value.h:682:14: error: function definition does not declare parameters ArrayIndex index_{}; ^ /usr/local/Cellar/jsoncpp/1.9.1/include/json/value.h:683:8: error: function definition does not declare parameters Kind kind_{kindNone}; ^ /usr/local/Cellar/jsoncpp/1.9.1/include/json/value.h:784:8: error: function definition does not declare parameters bool isNull_{true}; ^ In file included from /Users/tajammul/Documents/packages/bamtools/src/toolkit/bamtools_filter.cpp:19: In file included from /usr/local/Cellar/jsoncpp/1.9.1/include/json/json.h:11: /usr/local/Cellar/jsoncpp/1.9.1/include/json/reader.h:242:12: error: function definition does not declare parameters Location begin_{}; ^ /usr/local/Cellar/jsoncpp/1.9.1/include/json/reader.h:243:12: error: function definition does not declare parameters Location end_{}; ^ /usr/local/Cellar/jsoncpp/1.9.1/include/json/reader.h:244:12: error: function definition does not declare parameters Location current_{}; ^ /usr/local/Cellar/jsoncpp/1.9.1/include/json/reader.h:245:12: error: function definition does not declare parameters Location lastValueEnd_{}; ^ /usr/local/Cellar/jsoncpp/1.9.1/include/json/reader.h:246:10: error: function definition does not declare parameters Value* lastValue_{}; ^ /usr/local/Cellar/jsoncpp/1.9.1/include/json/reader.h:249:8: error: function definition does not declare parameters bool collectComments_{}; ^ /usr/local/Cellar/jsoncpp/1.9.1/include/json/reader.h:256:27: warning: defaulted function definitions are a C++11 extension [-Wc++11-extensions] virtual ~CharReader() = default; ^ /usr/local/Cellar/jsoncpp/1.9.1/include/json/reader.h:282:26: warning: defaulted function definitions are a C++11 extension [-Wc++11-extensions] virtual ~Factory() = default; ^ /usr/local/Cellar/jsoncpp/1.9.1/include/json/reader.h:347:24: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] ~CharReaderBuilder() override; ^ fatal error: too many errors emitted, stopping now [-ferror-limit=] 35 warnings and 20 errors generated. make[2]: *** [src/toolkit/CMakeFiles/bamtools_cmd.dir/bamtools_filter.cpp.o] Error 1 make[1]: *** [src/toolkit/CMakeFiles/bamtools_cmd.dir/all] Error 2 make: *** [all] Error 2
I checked JsonCpp is installed but still there are error.
Why it is so?

My feeling is you're using an ancient compiler. Bamtools implicitly now requires C++11, due to jsoncpp being a C++11 library. Which compiler are you using?

I am using gcc compiler.

are you using GCC 2.95 from 1998 or GCC 9.3 from 4 weeks ago?

I am using "gcc 9.3.0_1" which was installed on Mac using brew

First I cloned from git
git clone git://github.com/pezmaster31/bamtools.git
then also tried using

export CC=clang export CXX=clang++

mkdir build

cd build

cmake ..

make

I've added C++11 as an explicit requirement, please give it a try.