[odb-users] segmentation error on the hello example(w.r.t auto_ptr<database> db (new odb::mysql::database (argc, argv));)

Boris Kolpackov boris at codesynthesis.com
Thu Mar 25 09:22:52 EDT 2021

ys C <youngsunhere at gmail.com> writes:

> However when driver  is run as below, I get segmentation error.
> *./driver --user root --database cpp_test*
> My debugging only got so far as finding out that it was due to L 62 in
> *database.hxx*
> *auto_ptr<database> db (new odb::mysql::database (argc, argv));)*
> I am running on Ubuntu 18.04, using mysql for db, as mentioned.
> Could this be installation issue?

Yes, this could be a compiler/ABI mismatch between the compiler that
you use to build the example and that was used to build the libodb*
packages (I assume you are using system-installed ones).

If you want to try to eliminate this possibility, I would suggest
building the 2.5 pre-release from source as described here:


Otherwise (or if you have the same issues with 2.5), you will
need to build the test with debug information (-g) and look
around in the debugger (e.g., stack trace, etc) for what might
be causing this.

More information about the odb-users mailing list