[odb-users] warning: ignoring #pragma db object [-Wunknown-pramas]

Menashe Rosemberg rosemberg at ymail.com
Wed Sep 14 04:39:15 EDT 2016


 Hi friends,
I new with c++ and I wanted to use ODB like my way to access the MySQL database.
I start to learn about it from odb-manual and I try to follow all steps described there.
My enviroment is:Linux xenial1604x86 4.4.0-36-generic #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
Code::Blocks configured to:GNU GCC compiller (Have G++ follow the C++11 ISO C++ language standard) (build-essential)MySQL-Server and MySQL-Server and LibMYSQLClient-devODB 2.4 (intalled form apt-get command line)

 I've been stuck with this problem. The GCC compiller simply ignore all #pragma statement.
What I need to do to fix it?
Bellow the log from Code::Blocks Build messages.
Best regards,M.Rosemberg
||=== Build: Debug in ODBTest (compiler: GNU GCC Compiler) ===|
/home/administrator/Desktop/ProjectS/ODBTest/Person.hxx|10|warning: ignoring #pragma db object [-Wunknown-pragmas]|
/home/administrator/Desktop/ProjectS/ODBTest/Person.hxx|28|warning: ignoring #pragma db id [-Wunknown-pragmas]|
/home/administrator/Desktop/ProjectS/ODBTest/Person.hxx|10|warning: ignoring #pragma db object [-Wunknown-pragmas]|
/home/administrator/Desktop/ProjectS/ODBTest/Person.hxx|28|warning: ignoring #pragma db id [-Wunknown-pragmas]|
obj/Debug/Person-odb.o||In function `odb::access::object_traits_impl<person, (odb::database_id)0>::grow(odb::access::object_traits_impl<person, (odb::database_id)0>::image_type&, char*)':|
/home/administrator/Desktop/ProjectS/ODBTest/Person-odb.cxx|99|undefined reference to `odb::details::basic_buffer_base::capacity(unsigned long, unsigned long)'|
/home/administrator/Desktop/ProjectS/ODBTest/Person-odb.cxx|107|undefined reference to `odb::details::basic_buffer_base::capacity(unsigned long, unsigned long)'|
obj/Debug/Person-odb.o||In function `odb::access::object_traits_impl<person, (odb::database_id)0>::init(odb::access::object_traits_impl<person, (odb::database_id)0>::image_type&, person const&, odb::mysql::statement_kind)':|
/home/administrator/Desktop/ProjectS/ODBTest/Person-odb.cxx|222|undefined reference to `odb::mysql::string_value_traits::set_image(odb::details::basic_buffer<char>&, unsigned long&, bool&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'|
/home/administrator/Desktop/ProjectS/ODBTest/Person-odb.cxx|243|undefined reference to `odb::mysql::string_value_traits::set_image(odb::details::basic_buffer<char>&, unsigned long&, bool&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'|
obj/Debug/Person-odb.o||In function `odb::access::object_traits_impl<person, (odb::database_id)0>::persist(odb::database&, person&)':|
/home/administrator/Desktop/ProjectS/ODBTest/Person-odb.cxx|399|undefined reference to `odb::mysql::transaction::current()'|
/home/administrator/Desktop/ProjectS/ODBTest/Person-odb.cxx|435|undefined reference to `odb::mysql::insert_statement::execute()'|
/home/administrator/Desktop/ProjectS/ODBTest/Person-odb.cxx|436|undefined reference to `typeinfo for odb::object_already_persistent'|
obj/Debug/Person-odb.o||In function `odb::access::object_traits_impl<person, (odb::database_id)0>::update(odb::database&, person const&)':|
/home/administrator/Desktop/ProjectS/ODBTest/Person-odb.cxx|455|undefined reference to `odb::mysql::transaction::current()'|
/home/administrator/Desktop/ProjectS/ODBTest/Person-odb.cxx|499|undefined reference to `odb::mysql::update_statement::execute()'|
/home/administrator/Desktop/ProjectS/ODBTest/Person-odb.cxx|500|undefined reference to `typeinfo for odb::object_not_persistent'|
obj/Debug/Person-odb.o||In function `odb::access::object_traits_impl<person, (odb::database_id)0>::erase(odb::database&, unsigned long const&)':|
/home/administrator/Desktop/ProjectS/ODBTest/Person-odb.cxx|514|undefined reference to `odb::mysql::transaction::current()'|
/home/administrator/Desktop/ProjectS/ODBTest/Person-odb.cxx|529|undefined reference to `odb::mysql::delete_statement::execute()'|
/home/administrator/Desktop/ProjectS/ODBTest/Person-odb.cxx|530|undefined reference to `typeinfo for odb::object_not_persistent'|
obj/Debug/Person-odb.o||In function `odb::access::object_traits_impl<person, (odb::database_id)0>::find(odb::database&, unsigned long const&)':|
/home/administrator/Desktop/ProjectS/ODBTest/Person-odb.cxx|549|undefined reference to `odb::mysql::transaction::current()'|
obj/Debug/Person-odb.o||In function `odb::access::object_traits_impl<person, (odb::database_id)0>::find(odb::database&, unsigned long const&, person&)':|
/home/administrator/Desktop/ProjectS/ODBTest/Person-odb.cxx|597|undefined reference to `odb::mysql::transaction::current()'|
obj/Debug/Person-odb.o||In function `odb::access::object_traits_impl<person, (odb::database_id)0>::reload(odb::database&, person&)':|
/home/administrator/Desktop/ProjectS/ODBTest/Person-odb.cxx|630|undefined reference to `odb::mysql::transaction::current()'|
obj/Debug/Person-odb.o||In function `odb::access::object_traits_impl<person, (odb::database_id)0>::find_(odb::mysql::object_statements<person>&, unsigned long const*)':|
/home/administrator/Desktop/ProjectS/ODBTest/Person-odb.cxx|684|undefined reference to `odb::mysql::select_statement::execute()'|
/home/administrator/Desktop/ProjectS/ODBTest/Person-odb.cxx|686|undefined reference to `odb::mysql::select_statement::fetch(bool)'|
/home/administrator/Desktop/ProjectS/ODBTest/Person-odb.cxx|698|undefined reference to `odb::mysql::select_statement::refetch()'|
obj/Debug/Person-odb.o||In function `odb::access::object_traits_impl<person, (odb::database_id)0>::query(odb::database&, odb::mysql::query_base const&)':|
/home/administrator/Desktop/ProjectS/ODBTest/Person-odb.cxx|714|undefined reference to `odb::mysql::transaction::current()'|
/home/administrator/Desktop/ProjectS/ODBTest/Person-odb.cxx|734|undefined reference to `odb::mysql::query_base::clause[abi:cxx11]() const'|
/home/administrator/Desktop/ProjectS/ODBTest/Person-odb.cxx|737|undefined reference to `odb::mysql::query_base::init_parameters() const'|
/home/administrator/Desktop/ProjectS/ODBTest/Person-odb.cxx|745|undefined reference to `odb::details::shared'|
/home/administrator/Desktop/ProjectS/ODBTest/Person-odb.cxx|745|undefined reference to `odb::mysql::select_statement::select_statement(odb::mysql::connection&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, bool, odb::mysql::binding&, odb::mysql::binding&)'|
/home/administrator/Desktop/ProjectS/ODBTest/Person-odb.cxx|747|undefined reference to `odb::mysql::select_statement::execute()'|
/home/administrator/Desktop/ProjectS/ODBTest/Person-odb.cxx|751|undefined reference to `odb::details::shared'|
obj/Debug/Person-odb.o||In function `odb::access::object_traits_impl<person, (odb::database_id)0>::erase_query(odb::database&, odb::mysql::query_base const&)':|
/home/administrator/Desktop/ProjectS/ODBTest/Person-odb.cxx|762|undefined reference to `odb::mysql::transaction::current()'|
/home/administrator/Desktop/ProjectS/ODBTest/Person-odb.cxx|768|undefined reference to `odb::mysql::query_base::clause[abi:cxx11]() const'|
/home/administrator/Desktop/ProjectS/ODBTest/Person-odb.cxx|771|undefined reference to `odb::mysql::query_base::init_parameters() const'|
/home/administrator/Desktop/ProjectS/ODBTest/Person-odb.cxx|775|undefined reference to `odb::mysql::delete_statement::delete_statement(odb::mysql::connection&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, odb::mysql::binding&)'|
/home/administrator/Desktop/ProjectS/ODBTest/Person-odb.cxx|777|undefined reference to `odb::mysql::delete_statement::execute()'|
/home/administrator/Desktop/ProjectS/ODBTest/Person-odb.cxx|775|undefined reference to `odb::mysql::delete_statement::~delete_statement()'|
/home/administrator/Desktop/ProjectS/ODBTest/Person-odb.cxx|775|undefined reference to `odb::mysql::delete_statement::~delete_statement()'|
obj/Debug/Person-odb.o||In function `odb::details::shared_base::_dec_ref()':|
/usr/include/odb/details/shared-ptr/base.ixx|57|undefined reference to `odb::details::shared_base::_dec_ref_callback()'|
obj/Debug/Person-odb.o||In function `odb::mysql::auto_result::~auto_result()':|
/usr/include/odb/mysql/statement.hxx|222|undefined reference to `odb::mysql::select_statement::free_result()'|
obj/Debug/Person-odb.o||In function `odb::mysql::statements_base::statements_base(odb::mysql::connection&)':|
/usr/include/odb/mysql/statements-base.hxx|53|undefined reference to `vtable for odb::mysql::statements_base'|
obj/Debug/Person-odb.o||In function `odb::mysql::object_statements_base::object_statements_base(odb::mysql::connection&)':|
/usr/include/odb/mysql/simple-object-statements.hxx|148|undefined reference to `vtable for odb::mysql::object_statements_base'|
obj/Debug/Person-odb.o||In function `odb::object_already_persistent::object_already_persistent()':|
/usr/include/odb/exceptions.hxx|133|undefined reference to `vtable for odb::object_already_persistent'|
obj/Debug/Person-odb.o||In function `odb::object_not_persistent::object_not_persistent()':|
/usr/include/odb/exceptions.hxx|124|undefined reference to `vtable for odb::object_not_persistent'|
obj/Debug/Person-odb.o||In function `odb::object_traits_impl<person, (odb::database_id)0>::statements_type& odb::mysql::statement_cache::find_object<person>()':|
/usr/include/odb/mysql/statement-cache.txx|36|undefined reference to `odb::details::shared'|
obj/Debug/Person-odb.o||In function `odb::mysql::object_statements<person>::persist_statement()':|
/usr/include/odb/mysql/simple-object-statements.hxx|357|undefined reference to `odb::details::shared'|
/usr/include/odb/mysql/simple-object-statements.hxx|357|undefined reference to `odb::mysql::insert_statement::insert_statement(odb::mysql::connection&, char const*, bool, odb::mysql::binding&, odb::mysql::binding*, bool)'|
obj/Debug/Person-odb.o||In function `odb::mysql::object_statements<person>::update_statement()':|
/usr/include/odb/mysql/simple-object-statements.hxx|390|undefined reference to `odb::details::shared'|
/usr/include/odb/mysql/simple-object-statements.hxx|390|undefined reference to `odb::mysql::update_statement::update_statement(odb::mysql::connection&, char const*, bool, odb::mysql::binding&, bool)'|
obj/Debug/Person-odb.o||In function `odb::mysql::object_statements<person>::erase_statement()':|
/usr/include/odb/mysql/simple-object-statements.hxx|405|undefined reference to `odb::details::shared'|
/usr/include/odb/mysql/simple-object-statements.hxx|405|undefined reference to `odb::mysql::delete_statement::delete_statement(odb::mysql::connection&, char const*, odb::mysql::binding&, bool)'|
obj/Debug/Person-odb.o||In function `odb::mysql::object_statements<person>::find_statement()':|
/usr/include/odb/mysql/simple-object-statements.hxx|373|undefined reference to `odb::details::shared'|
/usr/include/odb/mysql/simple-object-statements.hxx|373|undefined reference to `odb::mysql::select_statement::select_statement(odb::mysql::connection&, char const*, bool, bool, odb::mysql::binding&, odb::mysql::binding&, bool)'|
obj/Debug/Person-odb.o||In function `odb::object_result_impl<person>::~object_result_impl()':|
/usr/include/odb/simple-object-result.hxx|26|undefined reference to `odb::result_impl::~result_impl()'|
obj/Debug/Person-odb.o||In function `odb::mysql::object_statements<person>::object_statements(odb::mysql::connection&)':|
/usr/include/odb/mysql/simple-object-statements.txx|52|undefined reference to `odb::mysql::object_statements_base::~object_statements_base()'|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build failed: 50 error(s), 4 warning(s) (0 minute(s), 2 second(s)) ===|


More information about the odb-users mailing list