DaoPointer build error w/QT5.0.1 on OS X

Forum for posting problems using QxOrm library

DaoPointer build error w/QT5.0.1 on OS X

Postby mjbraun » Fri Feb 22, 2013 4:53 am

(I'm brushing off my C++ skills, so apologies if I overlooked an obvious answer.)

I'm running into compile errors with QxORM 1.2.4 using QT5.0.1 (clang 64bit) on OS X Mountain Lion (1.8.2) with Boost 1.53.0 installed via Homebrew. Compiling (within Creator and from the command line) give the same errors:

Code: Select all
In file included from ….QxOrm-build-Desktop_Qt_5_0_1_clang_64bit-Debug/../QxOrm/include/QxCommon/QxAnyCastDynamic.h:45:
….QxOrm-build-Desktop_Qt_5_0_1_clang_64bit-Debug/../QxOrm/include/QxDao/QxDaoPointer.h:175:97: error: use 'template' keyword to treat 'staticCast' as a dependent template name
   template <class X> qx::dao::ptr<X> staticCast() const       { return qx::dao::ptr<X>(m_pWork.staticCast<X>(), m_pOriginal.staticCast<X>()); }
                                                                                                ^
                                                                                                template
….QxOrm-build-Desktop_Qt_5_0_1_clang_64bit-Debug/../QxOrm/include/QxDao/QxDaoPointer.h:175:126: error: use 'template' keyword to treat 'staticCast' as a dependent template name
   template <class X> qx::dao::ptr<X> staticCast() const       { return qx::dao::ptr<X>(m_pWork.staticCast<X>(), m_pOriginal.staticCast<X>()); }
                                                                                                                             ^
                                                                                                                             template
….QxOrm-build-Desktop_Qt_5_0_1_clang_64bit-Debug/../QxOrm/include/QxDao/QxDaoPointer.h:176:97: error: use 'template' keyword to treat 'dynamicCast' as a dependent template name
   template <class X> qx::dao::ptr<X> dynamicCast() const      { return qx::dao::ptr<X>(m_pWork.dynamicCast<X>(), m_pOriginal.dynamicCast<X>()); }
                                                                                                ^
                                                                                                template
….QxOrm-build-Desktop_Qt_5_0_1_clang_64bit-Debug/../QxOrm/include/QxDao/QxDaoPointer.h:176:127: error: use 'template' keyword to treat 'dynamicCast' as a dependent template name
   template <class X> qx::dao::ptr<X> dynamicCast() const      { return qx::dao::ptr<X>(m_pWork.dynamicCast<X>(), m_pOriginal.dynamicCast<X>()); }
                                                                                                                              ^
                                                                                                                              template
….QxOrm-build-Desktop_Qt_5_0_1_clang_64bit-Debug/../QxOrm/include/QxDao/QxDaoPointer.h:177:97: error: use 'template' keyword to treat 'constCast' as a dependent template name
   template <class X> qx::dao::ptr<X> constCast() const        { return qx::dao::ptr<X>(m_pWork.constCast<X>(), m_pOriginal.constCast<X>()); }
                                                                                                ^
                                                                                                template
….QxOrm-build-Desktop_Qt_5_0_1_clang_64bit-Debug/../QxOrm/include/QxDao/QxDaoPointer.h:177:125: error: use 'template' keyword to treat 'constCast' as a dependent template name
   template <class X> qx::dao::ptr<X> constCast() const        { return qx::dao::ptr<X>(m_pWork.constCast<X>(), m_pOriginal.constCast<X>()); }
                                                                                                                            ^
                                                                                                                            template
6 errors generated.
make[1]: *** [debug/IxSingleton.o] Error 1


I also pulled down the 1.2.5_BETA_08 I came across while looking for a resolution, but the problem remains. Any suggestions for what I might be doing wrong? I appreciate any assistance!
mjbraun
 
Posts: 4
Joined: Fri Feb 22, 2013 4:42 am

Re: DaoPointer build error w/QT5.0.1 on OS X

Postby qxorm » Fri Feb 22, 2013 10:49 am

Hi,

With Qt5, you must use the last BETA version : QxOrm_1.2.5_BETA_08.
You can download it here : http://www.qxorm.com/version/QxOrm_1.2.5_BETA_08.zip

You are compiling with clang : sorry, but clang has not been tested yet with QxOrm library.
On MacOSX, you have to use GCC.
qxorm
Site Admin
 
Posts: 481
Joined: Mon Apr 12, 2010 7:45 am

Re: DaoPointer build error w/QT5.0.1 on OS X

Postby mjbraun » Fri Feb 22, 2013 7:18 pm

It's GCCthen: as I mentioned, I had previously tried 1.2.5 BETA 8. However, I can't for the life of me figure out how to cleanly build QT everywhere with GCC so that I have the new toolchain set up (and recognizable in QT Creator, ideally). I have GCC 4.2 (also via macports), I've pulled all the links to llvm out of /usr/bin and replaced them with links to GCC/G++ but it seems that ./configure is "clang-ing" everything still.

Forgive the ignorance, as I'm sure I'm missing something. Also, thank you for your response!
mjbraun
 
Posts: 4
Joined: Fri Feb 22, 2013 4:42 am

Re: DaoPointer build error w/QT5.0.1 on OS X

Postby qxorm » Sat Feb 23, 2013 10:45 am

I don't understand what do you want exactly !
QxOrm library works fine on MacOSX using GCC : to configure your Mac, sorry I can't help you !
You should try to find a Mac developper forum to help you to install your dev environment with GCC.
qxorm
Site Admin
 
Posts: 481
Joined: Mon Apr 12, 2010 7:45 am

Re: DaoPointer build error w/QT5.0.1 on OS X

Postby mjbraun » Sat Feb 23, 2013 6:22 pm

I don't understand what do you want exactly !

It's seeming like that may be both of us! :)

No worries: Qt5 is still "fresh out of the oven", so I'll stick with the DB functionality it provides for now until it's matured a bit more. Thank you very much for the help!
mjbraun
 
Posts: 4
Joined: Fri Feb 22, 2013 4:42 am

Re: DaoPointer build error w/QT5.0.1 on OS X

Postby qxorm » Sun Feb 24, 2013 11:03 am

As I said, your problem comes from your compiler : clang has not been tested yet with QxOrm library.
But if you have some time, I would appreciate if you could test and validate clang compiler.
To fix your first compilation error, just follow those steps :
1- go to ./include/QxDao/ directory of your QxOrm package ;
2- open QxDaoPointer.h file (it is where you have your error) ;
3- replace lines from 175 to 177 by those lines :
Code: Select all
   template <class X> qx::dao::ptr<X> staticCast() const       { return qx::dao::ptr<X>(m_pWork.template staticCast<X>(), m_pOriginal.template staticCast<X>()); }
   template <class X> qx::dao::ptr<X> dynamicCast() const      { return qx::dao::ptr<X>(m_pWork.template dynamicCast<X>(), m_pOriginal.template dynamicCast<X>()); }
   template <class X> qx::dao::ptr<X> constCast() const        { return qx::dao::ptr<X>(m_pWork.template constCast<X>(), m_pOriginal.template constCast<X>()); }

I think it will fix your compilation errors on this file, but maybe you will have some other errors on other files, we will see...
I have tested and this fix doesn't break compilation on MSVC2008 on Windows, so for me it's ok, I will include this path on the next release...
qxorm
Site Admin
 
Posts: 481
Joined: Mon Apr 12, 2010 7:45 am

Re: DaoPointer build error w/QT5.0.1 on OS X

Postby mjbraun » Mon Feb 25, 2013 1:14 am

Yep, that fixed the error. Thanks!

Note that the build did fail out later on, however (FYI):
Code: Select all
../QxOrm/src/QxCommon/QxSimpleCrypt.cpp:144:36: error: no member named 'fromAscii' in 'QString'
   QString cypherString = QString::fromAscii(cypher.toBase64());
                          ~~~~~~~~~^
../QxOrm/src/QxCommon/QxSimpleCrypt.cpp:151:36: error: no member named 'fromAscii' in 'QString'
   QString cypherString = QString::fromAscii(cypher.toBase64());
                          ~~~~~~~~~^
../QxOrm/src/QxCommon/QxSimpleCrypt.cpp:157:67: error: no member named 'toAscii' in 'QString'
   QByteArray cyphertextArray = QByteArray::fromBase64(cyphertext.toAscii());
                                                       ~~~~~~~~~~ ^
../QxOrm/src/QxCommon/QxSimpleCrypt.cpp:172:67: error: no member named 'toAscii' in 'QString'
   QByteArray cyphertextArray = QByteArray::fromBase64(cyphertext.toAscii());
                                                       ~~~~~~~~~~ ^
4 errors generated.
make[1]: *** [debug/QxSimpleCrypt.o] Error 1
mjbraun
 
Posts: 4
Joined: Fri Feb 22, 2013 4:42 am

Re: DaoPointer build error w/QT5.0.1 on OS X

Postby qxorm » Mon Feb 25, 2013 7:57 am

Please, with Qt5, don't try to compile with QxOrm 1.2.4 : you have to use QxOrm 1.2.5 BETA 08 !
toAscii() and fromAscii() functions are noted "deprecated" in Qt5 documentation : so I have removed them in QxOrm 1.2.5 BETA 08.
You can download QxOrm BETA version here : http://www.qxorm.com/version/QxOrm_1.2.5_BETA_08.zip
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 6 guests