12

I'm using scons and ubuntu. When i when i make some program in using 'scons', there happen error like,

src/db/DBTextLoader.cc:296:3: error: ‘template class std::auto_ptr’ is deprecated [-Werror=deprecated-declarations]

/usr/include/c++/5/bits/unique_ptr.h:49:28: note: declared here template class auto_ptr;

and this is my command;

$ ./configuer

$ source something.sh

$ scons

Actually, I don't have any idea. I'm already searching this site and google. But I didn't find solution.

this is my g++ version (and c++ also was same version.)

g++ (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609

have any idea? Thank you.

6
  • What C++ standard version are you passing to G++ (-std=)? Commented Jul 12, 2017 at 9:23
  • 1
    Update to a later version of the package you try to install? One that doesn't use obsolete functionality. Or if there's no later version then search for another package that does what you want while still being actively developed. Commented Jul 12, 2017 at 9:24
  • @StoryTeller the version is c++11. so I'm input scons evn_file, -std=c++11. Commented Jul 12, 2017 at 9:27
  • @Someprogrammerdude I thing my c++ and g++ is already upgrade to a latest version. How can i find package what i need? Commented Jul 12, 2017 at 9:31
  • No not the compiler, the package you want to configure and use scons on. The "program" you have downloaded. Commented Jul 12, 2017 at 9:35

1 Answer 1

14

If you read some books of Scott Meyers, he strongly recommends not to use auto_ptr. Actually, new compilers may restrict it's usage because of lots of possible problems with it when using auto_ptr in STL containers, etc.

Instead, you should use std::unique_ptr if you don't want more that one copy of the object, and std::shared_ptr if you need to copy the pointer.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you very much!. I'm change 'auto_ptr' to 'unique_ptr', at that time my problem solved! Thank you again!

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.