0

I am new to both C++ and eclipse and I am trying to use smart pointers.

I installed boost using aptitude:

sudo apt-get install libboost-all-dev

then in my eclipse project I added "boost" to

/ properties / c/c++build / settings / cross G++ linker / Libraries /

now in my C++ I try to include smart pointers:

#include <boost/smart_ptr.h>

but I am told : unresolved inclusion: boost/smart_ptr.h

I am really not sure why. From my (limited) understanding, I should not need to look for the path to to the libboost and to the include path of the compiler. I based this on the fact that I included other libraries installed by aptitude and I could include them in my code directly.

Sounds like a basic question, but all the threads I could find were either about windows, or about boost being downloaded and manually compiled (in which case I understand the path has to be given to the compiler).

Anything I am missing ?

Thx a lot

4
  • You usually don't have to do anything. But the header is probably boost/shared_ptr.hpp. May 24, 2013 at 8:12
  • @juanchopanza Indeed ! Thanks a lot ... not sure if I should feel stupid or not. The examples I saw online were importing .h. In general, how to get to know that ?
    – Vince
    May 24, 2013 at 8:18
  • Boost uses .hpp, and you can see that from the code examples on their website. May 24, 2013 at 8:59
  • 1
    ok, my conclusion is : trust the examples of the official website, not the example of some random dude online --; do feel kinda stupid at the end. anyway, thx for the help
    – Vince
    May 24, 2013 at 9:44

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.