[odb-users] Error: auto_ptr is not a member of 'std'

Boris Kolpackov boris at codesynthesis.com
Thu Nov 3 09:37:42 EDT 2022


Steve Chester <stvchester at gmail.com> writes:

> I am testing out the ODB using the libodb vcpkg, however I'm running into
> an issue when I go to compile my project in visual studio 2022.  I am
> specifying my C++ version as C++20 and am running into errors stating that
> auto_ptr is not a member of std.  Looking at the documentation for
> std::auto_ptr, it looks like it was removed in C++17.  Is there a
> preprocessor definition I can define to replace the auto_ptr with
> either shared_ptr or unique_ptr?

I am not sure how vcpkg builds ODB (or which version), but the first
thing to try would be to add `--std c++11` to your ODB compiler
invocation and see if that helps.

If that doesn't help, you can try to get ODB via build2[1], which is
known to build the runtimes[2] in the C++20 mode with Visual Studio
2022.

[1] https://codesynthesis.com/products/odb/doc/install-build2.xhtml

[2] https://cppget.org/?builds=libodb&cf=windows*-msvc_17**



More information about the odb-users mailing list