QxOrm doesn't compile with Qt5.5.1

Forum for posting problems using QxOrm library

QxOrm doesn't compile with Qt5.5.1

Postby asnagni » Sun Jan 10, 2016 6:19 pm

Hi Guys,
I'm new to QxOrm library. I was able to build it on my environ QxOrm and link it against Qt4.8.7 but it doesn't work when I built it against Qt5.5.1
As an additional information, all the Qt5 example from the Qt package from Digia are building and running without any problem.

This is my environment:
1) Linux, kernel 4.2.8,
2) I'm using KDE Fedora 23 distribution. The 64 bit version
3) gcc version 5.3.1
4) I'm building from a fresh folder. I will just unzip the folder QxOrm_1.4.1.zip and cd in it and run:
a) qmake-qt5
b) make

Again what is strange is that it builds well for any other application or library but it doesn't work for QxOrm :roll: . If anyone faced this issue or has a solution for this problem that would be nice to share the solution. Thank you.

So, when I build QxOmr against qt5, I have these compilation errors:

Code: Select all
g++ -c -include release/QxOrm -pipe -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -O2 -Wall -W -D_REENTRANT -fPIC -D_QX_MODE_RELEASE -D_QX_BUILDING_QX_ORM -DQT_NO_DEBUG -DQT_SQL_LIB -DQT_CORE_LIB -I. -Iinclude -isystem /usr/include -isystem /usr/include/qt5 -isystem /usr/include/qt5/QtSql -isystem /usr/include/qt5/QtCore -Iqt/moc -I/usr/lib64/qt5/mkspecs/linux-g++ -o release/main.o src/main.cpp
/usr/lib64/qt5/bin/moc -D_QX_MODE_RELEASE -D_QX_BUILDING_QX_ORM -DQT_NO_DEBUG -DQT_SQL_LIB -DQT_CORE_LIB -I/usr/lib64/qt5/mkspecs/linux-g++ -I/home/asnagni/Desktop/FlashTag/Temp/QxOrm -I/home/asnagni/Desktop/FlashTag/Temp/QxOrm/include -I/usr/include -I/usr/include/qt5 -I/usr/include/qt5/QtSql -I/usr/include/qt5/QtCore -I/usr/include/c++/5.3.1 -I/usr/include/c++/5.3.1/x86_64-redhat-linux -I/usr/include/c++/5.3.1/backward -I/usr/lib/gcc/x86_64-redhat-linux/5.3.1/include -I/usr/local/include -I/usr/include include/QxDao/QxDaoAsync.h -o qt/moc/moc_QxDaoAsync.cpp
g++ -c -include release/QxOrm -pipe -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -O2 -Wall -W -D_REENTRANT -fPIC -D_QX_MODE_RELEASE -D_QX_BUILDING_QX_ORM -DQT_NO_DEBUG -DQT_SQL_LIB -DQT_CORE_LIB -I. -Iinclude -isystem /usr/include -isystem /usr/include/qt5 -isystem /usr/include/qt5/QtSql -isystem /usr/include/qt5/QtCore -Iqt/moc -I/usr/lib64/qt5/mkspecs/linux-g++ -o release/moc_QxDaoAsync.o qt/moc/moc_QxDaoAsync.cpp
qt/moc/moc_QxDaoAsync.cpp:15:2: error: #error "This file was generated using the moc from 5.5.1. It"
#error "This file was generated using the moc from 5.5.1. It"
^
qt/moc/moc_QxDaoAsync.cpp:16:2: error: #error "cannot be used with the include files from this version of Qt."
#error "cannot be used with the include files from this version of Qt."
^
qt/moc/moc_QxDaoAsync.cpp:17:2: error: #error "(The moc has changed too much.)"
#error "(The moc has changed too much.)"
^
qt/moc/moc_QxDaoAsync.cpp:22:5: error: ‘QByteArrayData’ does not name a type
QByteArrayData data[8];
^
qt/moc/moc_QxDaoAsync.cpp:28:24: error: ‘QByteArrayData’ was not declared in this scope
- idx * sizeof(QByteArrayData)) \
^
qt/moc/moc_QxDaoAsync.cpp:32:1: note: in expansion of macro ‘QT_MOC_LITERAL’
QT_MOC_LITERAL(0, 0, 33), // "qx::dao::detail::QxDaoAsyncRu..."
^
qt/moc/moc_QxDaoAsync.cpp:29:5: error: ‘Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET’ was not declared in this scope
)
^
qt/moc/moc_QxDaoAsync.cpp:32:1: note: in expansion of macro ‘QT_MOC_LITERAL’
QT_MOC_LITERAL(0, 0, 33), // "qx::dao::detail::QxDaoAsyncRu..."
^
asnagni
 
Posts: 3
Joined: Sun Jan 10, 2016 4:41 pm

Re: QxOrm doesn't compile with Qt5.5.1

Postby qxorm » Sun Jan 10, 2016 6:54 pm

Hello,

qt/moc/moc_QxDaoAsync.cpp:15:2: error: #error "This file was generated using the moc from 5.5.1. It cannot be used with the include files from this version of Qt. (The moc has changed too much.)"

The file moc_QxDaoAsync.cpp is not a part of QxOrm package, but it is generated by the qmake/make process (which execute the moc process).
So I don't think the problem come from QxOrm library (which is compatible and tested with Qt5) : I think your issue come from your Qt installation.
Why do you use qmake-qt5 command instead of qmake command ?

You can find some resources on internet about the same error message, for example : http://stackoverflow.com/questions/6042 ... -7-3-error
Or this one : http://www.qtcentre.org/threads/57642-q ... d4d4e838cd
Or this one : https://forum.qt.io/topic/24503/why-do- ... -qt5-0-1/5

You should check your paths. In the gcc command line, we can see :
-Iinclude -isystem /usr/include -isystem /usr/include/qt5 -isystem /usr/include/qt5/QtSql -isystem /usr/include/qt5/QtCore -Iqt/moc -I/usr/lib64/qt5/mkspecs
qxorm
Site Admin
 
Posts: 481
Joined: Mon Apr 12, 2010 7:45 am

Re: QxOrm doesn't compile with Qt5.5.1

Postby asnagni » Sun Jan 10, 2016 7:25 pm

Hi,
On linux systems you have qmake-qt5, qmake-qt4, and qmake-qt3 to build your application with the correct Qt libraries and tools.
On Linux distributions you have All these Qt versions installed and it working without any problem. You just need to use the correct qmake to accomplish what you want to accomplish. That is the reason why you have (qmake-qt5, qmake-qt4, and qmake-qt3). These commands are just a facade to the qmake command.

1) qmake-qt5: Is to build your application against Qt 5 environment
1) qmake-qt4: Is to build your application against Qt 4 environment
2) qmake-qt3: Is to build your application against Qt3 (fee people will use this one)

As I said, it works fine when I build anything else but QxOrm with Qt5 enviroment.
By the way QxOrm build fine with Qt4 and I was able to use it with Qt4.

I did some googling already yesterday. I will check the links that you are suggesting and I will also double check the Path to see if that solves anything.

Thank your for helping,
Alain-Serge
asnagni
 
Posts: 3
Joined: Sun Jan 10, 2016 4:41 pm

Re: QxOrm doesn't compile with Qt5.5.1

Postby qxorm » Sun Jan 10, 2016 7:34 pm

Maybe you could try to download and install a new instance of Qt5 (from official Qt website)?
This way, in the new Qt5 instance directory, you will have only Qt5, not a mix of Qt3, Qt4 and Qt5, which I think is related to your issue.
qxorm
Site Admin
 
Posts: 481
Joined: Mon Apr 12, 2010 7:45 am

Re: QxOrm doesn't compile with Qt5.5.1

Postby asnagni » Sun Jan 17, 2016 8:41 am

Hi,
I was able to have QxOrm working perfectly under Linux with Qt4 and Qt5. By default it was working with Qt4. so if to have build with Qt5, these are the steps you need to follow to have it to work with Qt5 (if you have Qt4and Qt5 development tools installed on your Linux box):

1) remove all Qt4 and Qt5 development tools

2) download Qt5 build it and install it in your local environment (Home). Once the installation is done you need to use the installed qmake from your home directory.



Thank you,
Alain-Serge
asnagni
 
Posts: 3
Joined: Sun Jan 10, 2016 4:41 pm

Re: QxOrm doesn't compile with Qt5.5.1

Postby qxorm » Sun Jan 17, 2016 5:55 pm

I was able to have QxOrm working perfectly under Linux with Qt4 and Qt5.

Great !
qxorm
Site Admin
 
Posts: 481
Joined: Mon Apr 12, 2010 7:45 am


Return to QxOrm - Help

Who is online

Users browsing this forum: No registered users and 5 guests