2

I want to make a sql application in QtCreator with the Qt libary and the ORM libary ODB but when i try to build the Hello example from the ODB site I only get a list of errors and I couldn't find out the problem.

My ideas are that their are missing some includes or that I haven't install it right.

Building Errors :

"
..\test\main.cxx:40:15: error: cannot convert 'odb::access::object_traits<person>::id_type' to 'long unsigned int' in assignment "

..\test\main.cxx:42:14: error: cannot convert 'odb::access::object_traits<person>::id_type' to 'long unsigned int' in assignment

In file included from C:/Qt/Qt5.4.0/Tools/mingw491_32/i686-w64-mingw32/include/odb/database.hxx:26:0,
                 from ..\test\main.cxx:8:
C:/Qt/Qt5.4.0/Tools/mingw491_32/i686-w64-mingw32/include/odb/query.hxx: In instantiation of 'struct odb::query_selector<person, (odb::database_id)5u>':
..\test\main.cxx:47:30:   required from here

C:/Qt/Qt5.4.0/Tools/mingw491_32/i686-w64-mingw32/include/odb/query.hxx:104:10: error: invalid use of incomplete type 'struct odb::query_selector_impl<person, (odb::database_id)5u, (odb::class_kind)2u>'
   struct query_selector: query_selector_impl<T, DB, class_traits<T>::kind>

C:/Qt/Qt5.4.0/Tools/mingw491_32/i686-w64-mingw32/include/odb/query.hxx:84:10: error: declaration of 'struct odb::query_selector_impl<person, (odb::database_id)5u, (odb::class_kind)2u>'
   struct query_selector_impl;

..\test\main.cxx:47:30: error: no type named 'base_type' in 'struct odb::query_selector<person, (odb::database_id)5u>'
     typedef odb::query<person> query;

In file included from C:/Qt/Qt5.4.0/Tools/mingw491_32/i686-w64-mingw32/include/odb/prepared-query.hxx:12:0,
                 from C:/Qt/Qt5.4.0/Tools/mingw491_32/i686-w64-mingw32/include/odb/database.hxx:27,
                 from ..\test\main.cxx:8:
C:/Qt/Qt5.4.0/Tools/mingw491_32/i686-w64-mingw32/include/odb/result.hxx: In instantiation of 'class odb::result<person>':
..\test\main.cxx:55:17:   required from here
C:/Qt/Qt5.4.0/Tools/mingw491_32/i686-w64-mingw32/include/odb/result.hxx:75:9: error: invalid use of incomplete type 'class odb::result_base<person, (odb::class_kind)2u>'
   class result: result_base<T, class_traits<T>::kind> "

This list of errors is much longer so link to project files and full list of errors.

Jemshit
  • 9,501
  • 5
  • 69
  • 106
  • Where do you call the `odb` compiler? The `*.hxx` files are usually generated by the `odb` compiler. – Thomas Matthews Apr 09 '15 at 23:59
  • https://mega.co.nz/#!bhxmFZAL!FYwC4sVeudGp85FL2fJ84E8Vn7IAhHpCUXV5oi6J-uU. This link give you all project files , i though that odb Compiler was called by qt creator in the *.pro file. I only download the hello example from the odb site and the files ends with *.hxx ... – Jan Kraemer Apr 10 '15 at 10:28
  • 1
    So after some weeks i finally solved it : 1.) i have to include the person-odb.hxx 2.) the odb compiler seems only to work if i leave it as downloaded and give in the Qt .pro file the path to it (or over pathvariables) 3.) I build the ODB-libary in 64bit mode while QtCreator builds only in 32bit mode, so i built the libary on a pure 32bit compiler and copy the generated files into the QtCreators MinGW – Jan Kraemer Apr 27 '15 at 21:40

0 Answers0