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

ys C youngsunhere at gmail.com
Wed Mar 24 09:55:13 EDT 2021


I was able to compile the driver executable, with the following command in

*c++ -c person-odb.cxx*
*c++ -DDATABASE_MYSQL -c driver.cxx*
*c++ -o driver driver.o person-odb.o -lodb-mysql -lodb*

I also created the schema by,
mysql --user=root --database=cpp_test < person.sql
I checked that cpp_test was created with the people table.

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

*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?

Thanks for the help!

Best regards,
Youngsun Cho

More information about the odb-users mailing list