Results 1 to 20 of 35

Thread: Configuring Qmake mkspecs after it's built

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2012
    Posts
    219
    Thanks
    28
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Configuring Qmake mkspecs after it's built

    Why do you say it didn't work?
    1) Note the value of the qmake variable QMAKE_MKSPECS
    QMAKE_MKSPECS:/usr/share/qt4/mkspecs
    2) Changing the value of the $QMAKESPEC env variable to a non-existant location doesn't cause any error when running qmake.
    3) I get invalid qt version message in QtCreator when using qmake and trying to set a cross compile tool chain, regardless of whether $QMAKESPEC is set. It configures ok for local build which uses the qmake's qmakespec as configured for build

    Is it possible to do what I'm trying to do and I'm just missing something?

    Thanks,

    Dave Thomas

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Configuring Qmake mkspecs after it's built

    Quote Originally Posted by davethomaspilot View Post
    1) Note the value of the qmake variable QMAKE_MKSPECS
    QMAKE_MKSPECS:/usr/share/qt4/mkspecs
    2) Changing the value of the $QMAKESPEC env variable to a non-existant location doesn't cause any error when running qmake.
    3) I get invalid qt version message in QtCreator when using qmake and trying to set a cross compile tool chain, regardless of whether $QMAKESPEC is set. It configures ok for local build which uses the qmake's qmakespec as configured for build

    Is it possible to do what I'm trying to do and I'm just missing something?
    For me it works:
    qmake Code:
    1. !build_pass {
    2. linux-*:message(LINUX)
    3. win32-*:message(WINDOWS)
    4. }
    To copy to clipboard, switch view to plain text mode 

    QMAKESPEC=/home/wysota/Qt/5.3/gcc_64/mkspecs/win32-g++ qmake

    yields:
    Project MESSAGE: WINDOWS

    Changing the specs will not modify the value of qmake variables, why would it? You are still within the same qmake installation.

    Also remember you can always pass a different specs to qmake using the -spec parameter:

    qmake -spec windows-g++
    Last edited by wysota; 10th December 2014 at 12:59.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. The following user says thank you to wysota for this useful post:

    davethomaspilot (10th December 2014)

  4. #3
    Join Date
    Jun 2012
    Posts
    219
    Thanks
    28
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Configuring Qmake mkspecs after it's built

    Thanks for the reply. It helps a lot to know it SHOULD work.

    Maybe it's just QtCreator configuration issues. When I went back to native build on Raspberry Pi using QtCreator I kept getting messages about invalid Qt version when I tried going back to the native qmake. Turns out the real problem was that the build output directory was still pointing to the directory I was going to use on the ubuntu compiling machine--which doesn't exist from the RPI's point of view.

    So, given this bad error message, I suspect several errors cause the same "invalid qt version" error. I think what's really happening is that the qmake selection doesn't change when other errors occur, so if it was invalid, it stays invalid until the other issues are fixed.

    At least that's the path I'm going down next. I'll try get qmake working (creating makefiles with cross-compile toolchain) outside QtCreator, then use QtCreator using the -spec parameter if needed (I think I saw a thread indicating that may be required for cross-compiling).

    Does remote debugging work from QtCreator 4.8 on Ubuntu with rpi as target? Haven't tried yet, but if it doesn't I'm less enthused about going to cross-compilation development.

    I suspected the QMAKE_MKSPECS only indicated what was configured at build time, but there's nothing in the documentation (that I could find) that clarifies this.

    Thanks!

  5. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Configuring Qmake mkspecs after it's built

    Quote Originally Posted by davethomaspilot View Post
    Does remote debugging work from QtCreator 4.8 on Ubuntu with rpi as target?
    Qt Creator's current version is 3.3 so I can't say whether it will work in 4.8

    Haven't tried yet, but if it doesn't I'm less enthused about going to cross-compilation development.
    I don't see why it shouldn't if you have gdbserver for Pi available.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. #5
    Join Date
    Jun 2012
    Posts
    219
    Thanks
    28
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Configuring Qmake mkspecs after it's built

    So, I got it working using the -spec option like Wysota suggested.

    Thanks!


    Added after 1 27 minutes:


    I don't see why it shouldn't if you have gdbserver for Pi available.
    Yes, it works fine using the RPI gdbserver if I manuall start the gdbserver on the RPI and specify the debuggee (target) executable name.

    It would be nice if QtCreator would launch gdbserver on the remote machine, but I don't see how to do that in the docs. I tried using Debug->Start Debugging->Start and Debug Remote Application, but that didn't work. Does QtCreator support this -- automatic launching gdbserver and the target app on the remote machine?
    Last edited by davethomaspilot; 13th December 2014 at 18:26.

  7. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Configuring Qmake mkspecs after it's built

    Quote Originally Posted by davethomaspilot View Post
    It would be nice if QtCreator would launch gdbserver on the remote machine, but I don't see how to do that in the docs.
    Debug -> Start Debugging -> Start Remote Debug Server Attached to Process...
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  8. #7
    Join Date
    Jun 2012
    Posts
    219
    Thanks
    28
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Configuring Qmake mkspecs after it's built

    Debug -> Start Debugging -> Start Remote Debug Server Attached to Process..
    That action isn't there in QtCreator 2.4.1. Under Debugging->Start Debugging, the remote debugging actions are:



    • Start Remote Debug Server
    • Attach to Remote Debug Server
    • Start and Debug Remote application



    "Start Debug Server" seems to be presenting a list of running processes on the target. That seems more like something that should be labelled "attach to process on remote machine", but I haven't tried this action.

    "Attach to Remote Debug server" works, but only if I first launch the application under gdbserver first on the target platform. That's what I'm doing now.

    "Start and Debug Remote application" sounds like the action I want, but when I try it, I get the message "Debugging has finished" in the application output window. The remote application never started.

    Do I need to set up a start script on the host that gets executed on the target to launch gdbserver?

    I'm just trying to get as tight a compile-test-debug-edit-compile cycle as possible. Now it's really quick compared to native RPI development. so while having to switch context to ssh, vnc, or target console to launch gdbserver is not a big deal, if support for automatic launch of a remote target process (and gdbserver) is in QtCreator there I want to use it.

  9. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Configuring Qmake mkspecs after it's built

    Quote Originally Posted by davethomaspilot View Post
    That action isn't there in QtCreator 2.4.1.
    That's a really ancient version. Why don't you upgrade to 3.x?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  10. #9
    Join Date
    Jun 2012
    Posts
    219
    Thanks
    28
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Configuring Qmake mkspecs after it's built

    I'm using Ubuntu 12. 2.4.1 is the latest qtcreator available for it, according to apt-get.

    I started with a new version of Ubuntu, but the ia32-lib that's required for cross-compiling to a raspberry pi target isn't available for the newer Ubuntu releases. I spent a lot of time trying work-arounds with no success and got nothing but silence when I asked on various forums if anyone had a solution that didn't require a 12.x Ubuntu host.

    Will qtcreator 3.x work on Ubuntu 12? Can I get binaries using apt-get from somewhere, or would I have to build it? If I have to build it, can I use the qt4.8 binaries on that system? if I have to move up to qt5.x, then I have another pile o stuff to do to get qt5 up and going on the rpi.

    Thanks,

    Dave Thomas

  11. #10
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Configuring Qmake mkspecs after it's built

    Quote Originally Posted by davethomaspilot View Post
    I'm using Ubuntu 12. 2.4.1 is the latest qtcreator available for it, according to apt-get.
    Forget apt-get, download QtCreator from here: http://www.qt.io/download-open-source/#section-6

    I started with a new version of Ubuntu, but the ia32-lib that's required for cross-compiling to a raspberry pi target isn't available for the newer Ubuntu releases.
    You can use schroot or a similar tool to have a Ubuntu 12.x installation inside your Ubuntu 14.x system.

    Will qtcreator 3.x work on Ubuntu 12?
    Yes.

    Can I get binaries using apt-get from somewhere, or would I have to build it?
    The link I gave you contains downloads for a binary release of QtCreator.

    If I have to build it, can I use the qt4.8 binaries on that system? if I have to move up to qt5.x, then I have another pile o stuff to do to get qt5 up and going on the rpi.
    You are confusing two things. Creator is just a tool, it has nothing to do with version of Qt you use to write your projects with. Creator is built against Qt5 but it can work with both Qt4 and Qt5 projects. Just use the download link I gave you and all will be fine.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  12. #11
    Join Date
    Jun 2012
    Posts
    219
    Thanks
    28
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Configuring Qmake mkspecs after it's built

    You can use schroot or a similar tool to have a Ubuntu 12.x installation inside your Ubuntu 14.x system.
    I'm actually running a Vmware player on windows 7. Are you suggesting running Ubuntu 12 inside 14.x in a Vm session on windows? Why, is the latest qtcreator incompatible with Ubuntu 12?

    I understand QtCreator versus Qt libraries. But, I think I can do a lot of "GUI only" work on the Ubuntu host platform using Qt Designer and Qt4 stuff that will be compatible with what's available (without building qt) on the RPI. So, moving up to Qt5 on the host Ubuntu system would seem to only complicate things. Or, would it be easy to use a QtCreator built for Qt5, have the libraries it needs for running, but build local and target applications using Qt4? Whew....

    I started the Wizard, but I need to know what it's going to do before I run it. It looks like I choose a Qt5 version to install.

    I don't want to clobber the qt4 stuff until I understand the above issues better. Are you saying I can configure QtCreator built from Qt5 to use Qt4 for applications it builds?

    Thanks!

  13. #12
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Configuring Qmake mkspecs after it's built

    Quote Originally Posted by davethomaspilot View Post
    I'm actually running a Vmware player on windows 7. Are you suggesting running Ubuntu 12 inside 14.x in a Vm session on windows? Why, is the latest qtcreator incompatible with Ubuntu 12?
    No, you said you couldn't upgrade to newer kubuntu because of some missing library. I showed you how to do it - have a minimalistic Ubuntu 12 as a chroot in Ubuntu 14.

    I understand QtCreator versus Qt libraries. But, I think I can do a lot of "GUI only" work on the Ubuntu host platform using Qt Designer and Qt4 stuff that will be compatible with what's available (without building qt) on the RPI. So, moving up to Qt5 on the host Ubuntu system would seem to only complicate things. Or, would it be easy to use a QtCreator built for Qt5, have the libraries it needs for running, but build local and target applications using Qt4? Whew....
    Qt4 and Qt5 can live side by side. Qt Creator that I gave you a link to contains a bundled Qt5 environment so you don't have to build anything.

    I don't want to clobber the qt4 stuff until I understand the above issues better. Are you saying I can configure QtCreator built from Qt5 to use Qt4 for applications it builds?
    Just install the thing and stop worrying. I have a single instance of Creator working fine with Qt4 as well as Qt5, both native and cross-compiled. Creator is not tied to developing with any particular version of Qt. It just needs a particular version of Qt to run. And the binary release comes with one integrated which is totally separate from what you have in your system.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 1
    Last Post: 13th December 2014, 17:08
  2. Configuring qmake to put files inside proper folder
    By Momergil in forum Qt Programming
    Replies: 3
    Last Post: 11th May 2014, 12:02
  3. Replies: 6
    Last Post: 3rd December 2010, 20:51
  4. Replies: 5
    Last Post: 25th September 2007, 10:43
  5. 4.1.4 built from source, qmake fails with Hello World
    By Mookie in forum Installation and Deployment
    Replies: 6
    Last Post: 27th June 2006, 23:13

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.