I am on macOS High Sierra 10.13.6
I installed thrift as follows:
$ brew install thrift
It is the following version:
$ thrift --version
Thrift version 0.11.0
I installed boost as follows:
$ brew install boost
I have the following model.thrift file:
struct Person {
1: required i32 age;
}
I run the Thrift compiler to generate the cpp code as follows:
$ thrift -gen cpp model.thrift
I have to following cpp_encode.cpp file that includes the generate code:
#include "gen-cpp/model_types.h"
int main(int argc, char const *argv[])
{
return 0;
}
I attempt to compile the file as follows:
$ g++ -Wall -I /usr/local/include -L /usr/local/lib -o cpp_encode cpp_encode.cpp
The compiler version is as follows:
$ g++ --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 9.1.0 (clang-902.0.39.2)
Target: x86_64-apple-darwin17.7.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
I get the following compile error:
$ g++ -Wall -I /usr/local/include -L /usr/local/lib -o cpp_encode cpp_encode.cpp
In file included from cpp_encode.cpp:1:
In file included from ./gen-cpp/model_types.h:14:
In file included from /usr/local/include/thrift/TBase.h:24:
In file included from /usr/local/include/thrift/protocol/TProtocol.h:28:
In file included from /usr/local/include/thrift/transport/TTransport.h:24:
/usr/local/include/thrift/stdcxx.h:32:10: fatal error: 'boost/tr1/functional.hpp' file not found
#include <boost/tr1/functional.hpp>
The directory /usr/local/boost directory exists:
$ ls -1 /usr/local/include/boost
accumulators
algorithm
align
align.hpp
aligned_storage.hpp
any.hpp
archive
[...]
But the directory /usr/local/include/boost/tr1 does not exist:
$ ls -1 /usr/local/include/boost/tr1
ls: /usr/local/include/boost/tr1: No such file or directory
Should I install /usr/local/include/boost/tr1? If so, how?
Should I use Thrift differently?