[odb-users] Error when building examples.

Anurag Gupta anuragg at miltenyi.com
Fri Aug 4 18:31:07 EDT 2023


Hello,

I was able to install ODB 2.5.0 beta on my Ubuntu 22.04 with GCC 13.1. Now I'm trying to build the examples by following the instructions provided. I am able to configure the build to use "pgsql" but when I run make command it finishes with errors. Also, lots of warning about using std::auto_ptr. Please check the attached output of make.
Thank you!
Anurag Gupta

-------------- next part --------------
make  all-recursive
make[1]: Entering directory '/home/anuragg/ODB_Examples/odb-examples-2.4.0'
Making all in access
make[2]: Entering directory '/home/anuragg/ODB_Examples/odb-examples-2.4.0/access'
make  all-am
make[3]: Entering directory '/home/anuragg/ODB_Examples/odb-examples-2.4.0/access'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/home/anuragg/ODB_Examples/odb-examples-2.4.0/access'
make[2]: Leaving directory '/home/anuragg/ODB_Examples/odb-examples-2.4.0/access'
Making all in composite
make[2]: Entering directory '/home/anuragg/ODB_Examples/odb-examples-2.4.0/composite'
make  all-am
make[3]: Entering directory '/home/anuragg/ODB_Examples/odb-examples-2.4.0/composite'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/home/anuragg/ODB_Examples/odb-examples-2.4.0/composite'
make[2]: Leaving directory '/home/anuragg/ODB_Examples/odb-examples-2.4.0/composite'
Making all in container
make[2]: Entering directory '/home/anuragg/ODB_Examples/odb-examples-2.4.0/container'
make  all-am
make[3]: Entering directory '/home/anuragg/ODB_Examples/odb-examples-2.4.0/container'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/home/anuragg/ODB_Examples/odb-examples-2.4.0/container'
make[2]: Leaving directory '/home/anuragg/ODB_Examples/odb-examples-2.4.0/container'
Making all in hello
make[2]: Entering directory '/home/anuragg/ODB_Examples/odb-examples-2.4.0/hello'
make  all-am
make[3]: Entering directory '/home/anuragg/ODB_Examples/odb-examples-2.4.0/hello'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/home/anuragg/ODB_Examples/odb-examples-2.4.0/hello'
make[2]: Leaving directory '/home/anuragg/ODB_Examples/odb-examples-2.4.0/hello'
Making all in inheritance/polymorphism
make[2]: Entering directory '/home/anuragg/ODB_Examples/odb-examples-2.4.0/inheritance/polymorphism'
make  all-am
make[3]: Entering directory '/home/anuragg/ODB_Examples/odb-examples-2.4.0/inheritance/polymorphism'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/home/anuragg/ODB_Examples/odb-examples-2.4.0/inheritance/polymorphism'
make[2]: Leaving directory '/home/anuragg/ODB_Examples/odb-examples-2.4.0/inheritance/polymorphism'
Making all in inheritance/reuse
make[2]: Entering directory '/home/anuragg/ODB_Examples/odb-examples-2.4.0/inheritance/reuse'
make  all-am
make[3]: Entering directory '/home/anuragg/ODB_Examples/odb-examples-2.4.0/inheritance/reuse'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/home/anuragg/ODB_Examples/odb-examples-2.4.0/inheritance/reuse'
make[2]: Leaving directory '/home/anuragg/ODB_Examples/odb-examples-2.4.0/inheritance/reuse'
Making all in query
make[2]: Entering directory '/home/anuragg/ODB_Examples/odb-examples-2.4.0/query'
make  all-am
make[3]: Entering directory '/home/anuragg/ODB_Examples/odb-examples-2.4.0/query'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/home/anuragg/ODB_Examples/odb-examples-2.4.0/query'
make[2]: Leaving directory '/home/anuragg/ODB_Examples/odb-examples-2.4.0/query'
Making all in mapping
make[2]: Entering directory '/home/anuragg/ODB_Examples/odb-examples-2.4.0/mapping'
make  all-am
make[3]: Entering directory '/home/anuragg/ODB_Examples/odb-examples-2.4.0/mapping'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/home/anuragg/ODB_Examples/odb-examples-2.4.0/mapping'
make[2]: Leaving directory '/home/anuragg/ODB_Examples/odb-examples-2.4.0/mapping'
Making all in optimistic
make[2]: Entering directory '/home/anuragg/ODB_Examples/odb-examples-2.4.0/optimistic'
make  all-am
make[3]: Entering directory '/home/anuragg/ODB_Examples/odb-examples-2.4.0/optimistic'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/home/anuragg/ODB_Examples/odb-examples-2.4.0/optimistic'
make[2]: Leaving directory '/home/anuragg/ODB_Examples/odb-examples-2.4.0/optimistic'
Making all in pimpl
make[2]: Entering directory '/home/anuragg/ODB_Examples/odb-examples-2.4.0/pimpl'
make  all-am
make[3]: Entering directory '/home/anuragg/ODB_Examples/odb-examples-2.4.0/pimpl'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/home/anuragg/ODB_Examples/odb-examples-2.4.0/pimpl'
make[2]: Leaving directory '/home/anuragg/ODB_Examples/odb-examples-2.4.0/pimpl'
Making all in prepared
make[2]: Entering directory '/home/anuragg/ODB_Examples/odb-examples-2.4.0/prepared'
make  all-am
make[3]: Entering directory '/home/anuragg/ODB_Examples/odb-examples-2.4.0/prepared'
depbase=`echo driver.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
g++ -DHAVE_CONFIG_H   -I'.' -I'.'   -DDATABASE_PGSQL     -g -O2 -D_REENTRANT  -MT driver.o -MD -MP -MF $depbase.Tpo -c -o driver.o driver.cxx &&\
mv -f $depbase.Tpo $depbase.Po
In file included from driver.cxx:12:
database.hxx:35:13: warning: ‘template<class> class std::auto_ptr’ is deprecated: use 'std::unique_ptr' instead [-Wdeprecated-declarations]
   35 | inline std::auto_ptr<odb::database>
      |             ^~~~~~~~
In file included from /usr/local/include/c++/13.1.0/memory:78,
                 from driver.cxx:4:
/usr/local/include/c++/13.1.0/bits/unique_ptr.h:65:28: note: declared here
   65 |   template<typename> class auto_ptr;
      |                            ^~~~~~~~
database.hxx: In function ‘std::auto_ptr<odb::database> create_database(int&, char**)’:
database.hxx:84:3: warning: ‘template<class> class std::auto_ptr’ is deprecated: use 'std::unique_ptr' instead [-Wdeprecated-declarations]
   84 |   auto_ptr<database> db (new odb::pgsql::database (argc, argv));
      |   ^~~~~~~~
/usr/local/include/c++/13.1.0/bits/unique_ptr.h:65:28: note: declared here
   65 |   template<typename> class auto_ptr;
      |                            ^~~~~~~~
driver.cxx: In function ‘void query_factory(const char*, odb::connection&)’:
driver.cxx:31:3: warning: ‘template<class> class std::auto_ptr’ is deprecated: use 'std::unique_ptr' instead [-Wdeprecated-declarations]
   31 |   auto_ptr<params> p (new params);
      |   ^~~~~~~~
/usr/local/include/c++/13.1.0/bits/unique_ptr.h:65:28: note: declared here
   65 |   template<typename> class auto_ptr;
      |                            ^~~~~~~~
driver.cxx:35:17: error: no matching function for call to ‘odb::connection::cache_query(odb::prepared_query<person>&, std::auto_ptr<params>&)’
   35 |   c.cache_query (pq, p);
      |   ~~~~~~~~~~~~~~^~~~~~~
In file included from /usr/local/include/odb/database.hxx:28,
                 from driver.cxx:8:
/usr/local/include/odb/connection.hxx:78:5: note: candidate: ‘template<class T> void odb::connection::cache_query(const odb::prepared_query<T>&)’
   78 |     cache_query (const prepared_query<T>&);
      |     ^~~~~~~~~~~
/usr/local/include/odb/connection.hxx:78:5: note:   template argument deduction/substitution failed:
driver.cxx:35:17: note:   candidate expects 1 argument, 2 provided
   35 |   c.cache_query (pq, p);
      |   ~~~~~~~~~~~~~~^~~~~~~
/usr/local/include/odb/connection.hxx:83:5: note: candidate: ‘template<class T, class P> void odb::connection::cache_query(const odb::prepared_query<T>&, std::unique_ptr<P>)’
   83 |     cache_query (const prepared_query<T>&, std::unique_ptr<P> params);
      |     ^~~~~~~~~~~
/usr/local/include/odb/connection.hxx:83:5: note:   template argument deduction/substitution failed:
driver.cxx:35:17: note:   ‘std::auto_ptr<params>’ is not derived from ‘std::unique_ptr<P>’
   35 |   c.cache_query (pq, p);
      |   ~~~~~~~~~~~~~~^~~~~~~
driver.cxx: In function ‘int main(int, char**)’:
driver.cxx:54:5: warning: ‘template<class> class std::auto_ptr’ is deprecated: use 'std::unique_ptr' instead [-Wdeprecated-declarations]
   54 |     auto_ptr<database> db (create_database (argc, argv));
      |     ^~~~~~~~
/usr/local/include/c++/13.1.0/bits/unique_ptr.h:65:28: note: declared here
   65 |   template<typename> class auto_ptr;
      |                            ^~~~~~~~
driver.cxx:153:9: warning: ‘template<class> class std::auto_ptr’ is deprecated: use 'std::unique_ptr' instead [-Wdeprecated-declarations]
  153 |         auto_ptr<unsigned short> p (new unsigned short);
      |         ^~~~~~~~
/usr/local/include/c++/13.1.0/bits/unique_ptr.h:65:28: note: declared here
   65 |   template<typename> class auto_ptr;
      |                            ^~~~~~~~
driver.cxx:157:25: error: no matching function for call to ‘odb::database::cache_query(prep_query&, std::auto_ptr<short unsigned int>&)’
  157 |         db->cache_query (pq, p); // Assumes ownership of p.
      |         ~~~~~~~~~~~~~~~~^~~~~~~
In file included from /usr/local/include/odb/database.hxx:652:
/usr/local/include/odb/database.ixx:682:15: note: candidate: ‘template<class T> void odb::database::cache_query(const odb::prepared_query<T>&)’
  682 |   inline void database::
      |               ^~~~~~~~
/usr/local/include/odb/database.ixx:682:15: note:   template argument deduction/substitution failed:
driver.cxx:157:25: note:   candidate expects 1 argument, 2 provided
  157 |         db->cache_query (pq, p); // Assumes ownership of p.
      |         ~~~~~~~~~~~~~~~~^~~~~~~
/usr/local/include/odb/database.hxx:373:5: note: candidate: ‘template<class T, class P> void odb::database::cache_query(const odb::prepared_query<T>&, std::unique_ptr<P>)’
  373 |     cache_query (const prepared_query<T>&, std::unique_ptr<P> params);
      |     ^~~~~~~~~~~
/usr/local/include/odb/database.hxx:373:5: note:   template argument deduction/substitution failed:
driver.cxx:157:25: note:   ‘std::auto_ptr<short unsigned int>’ is not derived from ‘std::unique_ptr<P>’
  157 |         db->cache_query (pq, p); // Assumes ownership of p.
      |         ~~~~~~~~~~~~~~~~^~~~~~~
make[3]: *** [Makefile:356: driver.o] Error 1
make[3]: Leaving directory '/home/anuragg/ODB_Examples/odb-examples-2.4.0/prepared'
make[2]: *** [Makefile:299: all] Error 2
make[2]: Leaving directory '/home/anuragg/ODB_Examples/odb-examples-2.4.0/prepared'
make[1]: *** [Makefile:368: all-recursive] Error 1
make[1]: Leaving directory '/home/anuragg/ODB_Examples/odb-examples-2.4.0'
make: *** [Makefile:297: all] Error 2


More information about the odb-users mailing list