Reputation:
I am trying to work on a project that uses the boost C++ library. The project in question is
When I run make in the build directory I get
In file included from /Users/me/monitoring-client/main.cc:6:
In file included from /Users/me/monitoring-client/gnss_synchro_udp_source.h:4:
In file included from /opt/local/include/boost/asio.hpp:31:
In file included from /opt/local/include/boost/asio/basic_socket_iostream.hpp:24:
/opt/local/include/boost/asio/basic_socket_streambuf.hpp:586:7: error: C++ requires a type specifier for all
declarations
int timeout() const
the CMake file does ensure that c++11 is the standard and I have not modified anything from the site. I am working on macos Mojave.
How can i resolve this?
clang --version
Apple LLVM version 10.0.1 (clang-1001.0.46.4)
Target: x86_64-apple-darwin18.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
Upvotes: 1
Views: 145
Reputation: 418
I have seen this kind of problem before.
It was an error in the order in which includes were done.
Actually we used this kind of error on purpose to find the places in the code where we did it wrong.
So, @Scheff is most likely right. There is a #define timeout somewhere which shadows the intended timeout.
And yes, old style macros are evil nowadays when we have C++11, but old style macros in lowercase deserve a special place in hell.
Upvotes: 1