1. The error message is as follows
#include <iostream>#include<memory>#include<boost/shared_ptr.hpp>using namespacestd;using namespaceboost;intMainvoid){ for(inti =0; I <10000; ++i) {//unique_ptr<int> int_ptr (new int ());shared_ptr<int>p; } return 0;}
Autopointer.cpp:3:32:fatal error:boost/shared_ptr.hpp:no such file or directory
#include <boost/shared_ptr.hpp>
^
Compilation terminated.
Make: * * * [autopointer] Error 1
Press ENTER or type command to continue
It is obvious to find the head of the file posture Ah! Do you want to install the boost library? It took 10 minutes to realize that it was going to be installed! Please forgive me for this rookie.
2. Install the Boost library
So, think of Ubuntu under the installation should be very simple ah sudo apt-get should be able to solve AH.
sudo apt-get install libboost [Tab][tab] There will be a lot of hints
Found this library, Libboost-random1.55-dev should be.
So sudo apt-get install Libboost-random1.55-dev Wait a few minutes after compiling the above source code to solve the problem
Ubuntu 14.04 under Compile shared_ptr failed