I work on a cross-platform (Windows, Linux, Solaris) project. I want to use Boost's shared_ptr in this project.
How can I install it, and redistribute it with the project to the customers?
I don't have root permissions on Linux/Solaris, so I probably have to add Boost' sources to my sources, and build it together.
Also, our version of Solaris is very old (2.5.1, May 1996). Can it cause any problem with the building of shared_ptr?
Just install the boost header files (you don't need to compile and install the libraries for shared_ptr, because it's header only). Don't forget to check if the include paths for boost are set up right inside your IDE, so it will be able to find the header file.
In your code file, include this header:
#include<boost/shared_ptr.hpp>
and use it like this:
boost::shared_ptr<int> ptrToInt (new int);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With