Search code examples
c++amazon-web-servicesboostcloud9-ide

Can't get Boost C++ Libraries to work in an AWS Linux Environment


I am trying to transfer a C++ project started by a colleague to a AWS Cloud9 environment.The project was originally developed on Mac and makes use of the Boost library.

I've set up the AWS Cloud9 environment to use Amazon Linux. Once the environment created I import the project using the "Upload Local Folder" function.

The project is uploaded in the environment/projectName path.

I think try to install boost on the environment. I run the following commands to download boost

sudo yum install boost
sudo yum install boost-devel

I checked and boost is present at the following filepath:

/usr/include/boost

However, when I try to compile my code, I get a series of errors along the line of:

 lib/Category.h:12:10: fatal error: boost/container_hash/hash.hpp: No such file or directory
 #include <boost/container_hash/hash.hpp>

The makefile used has the -Ilib and -lboost_program_option flags. I've been looking for what they mean to no success.

I use g++.

I've tried including the -I and pointing to the boost path to no success. I have the feeling it can be due to an include path.

Thanks!


Solution

  • Amazon Linux 2 has boost 1.53. This is too old, and container_hash has not been yet available.

    You have to manually build newer version of boost.