March 22, 2012

OlivierB OlivierB
Lab Rat
23 posts

Qt5 wrong mkspec used in QtCreator

 

Hi all,

I have build a Qt5 under a Linux 64bits.
Now I try to use it in QtCreator. But, even with the GCC x86_64 set and QMKSPECS set to linux-g++-64, the qmake build step indicates “qmake application.pro -r -spec linux-g++”. And of course, it does not work at link time because Qt5 libs are 64bits…

Anyone has the same problem.

Thanks.

Olivier.

8 replies

March 23, 2012

Tobias Hunger Tobias Hunger
Robot Herder
3387 posts

So you are using a 64bit linux os with a 64bit gcc and a 64bit Qt? linux-g++ is the correct mkspec for you then.

Which version of Qt Creator is this by the way?

March 23, 2012

OlivierB OlivierB
Lab Rat
23 posts

Thanks Tobias for your answer.

Ok. I use the QtCreator from the SDK, so it is 2.4.1.
I was confused with the link error. I took the wrong road…
My .pro contained Qt4 modules which of course are not the same for Qt5.

So in the end, it is just that the current version of QtCreator seems not compatible with Qt5. I think this is normal?

Olivier.

March 23, 2012

Tobias Hunger Tobias Hunger
Robot Herder
3387 posts

AFAIK Qt Creator can build Qt5 applications.

The wizards, etc. are not yet updated though: Qt5 is not out yet and was a long way of when we released the 2.4 version of Qt Creator. It made little sense back then to update the wizards since the rearrangement of modules and classes was not even done!

Please try Qt Creator 2.5 (beta was just released) for Qt5 work. That should work better. Please file bug reports [bugreports.qt-project.org] if you run into trouble:-)

March 23, 2012

OlivierB OlivierB
Lab Rat
23 posts

I am able to build and run Qt5 application using QtCreator 2.4.1. As you say my problem came from the project creation wizard which still create project for Qt4, nothing abnormal here. So after manually update the .pro, the build works.

The problem I have is that QtCreator only find includes from qtbase module and not for qtdeclarative module for example. I’ll give a try to the 2.5 see if it works better.

March 23, 2012

Tobias Hunger Tobias Hunger
Robot Herder
3387 posts

There should not have been changes with regards to creator finding header files in 2.5. Does your project build? If it does, then creator should be able to pick up the headers, too.

March 23, 2012

OlivierB OlivierB
Lab Rat
23 posts

It should not but it does make a difference. :)
I have just switch to the 2.5 beta and now QtCreator find header files like QQuickView.
My application compile on both version.

March 23, 2012

Stephen Chu Stephen Chu
Lab Rat
70 posts
OlivierB wrote:
The problem I have is that QtCreator only find includes from qtbase module and not for qtdeclarative module for example. I’ll give a try to the 2.5 see if it works better.

Qt 5 requires module names in the include path, like:

  1. #include <QtCore/QString>

This no longer works:

  1. #include <QString>

March 23, 2012

OlivierB OlivierB
Lab Rat
23 posts

Stephen Chu wrote:

Qt 5 requires module names in the include path, like:
  1. #include <QtCore/QString>

This no longer works:

@#include <QString>@


Ok. My computer must by haunted!
For me, with the 2.5, I can use #include <QString> or #include <QQuickView> without a problem.
However, with the 2.4, I can’t even write #include <QtQuick/QQuickView> as QtQuick/ is not found.

 
  ‹‹ [solved] cannot get Qt creator start?      Qt Docs in QT creator ››

You must log in to post a reply. Not a member yet? Register here!