Click to See Complete Forum and Search --> : Smart Pointers from Boost.org
astewix
04-21-2003, 05:25 AM
Hey everyone,
Has anyone managed to successfully use anything from the smart pointer library from www.boost.org/libs/smart_ptr/index.htm ? I can't seem to even compile the thing. Any help is appreciated.
:D
Stuka
04-21-2003, 02:03 PM
I briefly threw a shared_ptr<> into some code of mine...I'm still playing with it big-time, so it's out again. However, I had no issues compiling the code with simple declarations in there. What kind of issues are you having?
astewix
04-21-2003, 08:30 PM
it's just having problems finding the hpp files.
smart_ptr_test.cpp:27:32: boost/scoped_ptr.hpp: No such file or directory
smart_ptr_test.cpp:28:34: boost/scoped_array.hpp: No such file or directory
smart_ptr_test.cpp:29:32: boost/shared_ptr.hpp: No such file or directory
smart_ptr_test.cpp:30:34: boost/shared_array.hpp: No such file or directory
smart_ptr_test.cpp:32:45: boost/detail/lightweight_test.hpp: No such file or dir
ectory
smart_ptr_test.cpp:40: `boost' was not declared in this scope
i compiled it with g++ -Wall -pedantic -ansi smart_ptr_test.cpp
and i've got a folder called boost with all the hpp files in there. So I'm a bit puzzled.
Did you use the shared_ptr<> from the boost libraries?
bwkaz
04-21-2003, 08:57 PM
You need to tell it where the boost directory is, with an I option (capital i). If you put them in ./boost/, then you need to add -I. to your compile command line (or put the include file in quotes).
Stuka
04-22-2003, 10:13 AM
Yes, I did, and bwkaz has your answer - you just need to point gcc to your include files.