/usr/local/bin/qmake4 does not specify a valid Qt install



  • Hi, I am trying to develop a small application on OpenBSD but I can't build anything right now on the Qt creator.
    I've read several cases like me but none of the answers has helped me.
    Qt Creator Ver 4.7.3
    Qt4

    So I've tried several times to do tools->options->+ and adding a path to qmake4 and qmake but it keeps saying they aren't valid.
    Anyone knows a way to solve this?

    Also, I've figured a way to get it to work temporarily. I delete all the packages related to qt, including qt4 and qt-creator.
    Then I download again qt4 and compile the source code of the qt-creator-1.3.1 (which btw fails towards the end).
    Then I use pkg_add qt-creator to install it properly and guess what, I don't get the error anymore!
    HOWEVER, after a few tries of debugging(which I still cannot do but hey, I guess I can do with only build/run) I get the same error again! This is obviously not an optimal solution so I'd really want to know whats going on. I'd really appreciate it.


  • Moderators

    Have you thought about installing the complete Qt SDK? It would do everything for you.

    Is your Qt properly installed, together with dependencies? Try pointing to qmake, not qmake4. Or, if you have su rights, copy qmake from qt's bin directory into /usr/local/bin.

    And another question, do you compile Qt yourself, or only Qt Creator? It's not clear from your message, and the steps to solve your problem might differ slightly depending on the answer. Also, I have no experience on BSD, so it might be the case, that it's some BSD-specific issue.

    Probably the best option is to build Qt from sources with "-prefix "$PWD/bin"" and no installation. This way you get a self-contained package, and specifying qmake from bin folder inside qt sources should work.

    I'm sorry if the post is written a bit chaotically, but I see a lot of possible solutions, and lack enough info to tell you the right one.



  • Thanks for replying.

    [quote author="sierdzio" date="1335721579"]Have you thought about installing the complete Qt SDK? It would do everything for you.
    [/quote]
    I don't know how I can install the whole SDK to OpenBSD, I am using this kind of mirrors to download individual packages right now and I couldn't find the complete SDK in the list.
    http://mirrors.nycbug.org/pub/OpenBSD/5.0/packages/i386/

    [quote author="sierdzio" date="1335721579"]
    Is your Qt properly installed, together with dependencies? Try pointing to qmake, not qmake4. Or, if you have su rights, copy qmake from qt's bin directory into /usr/local/bin.[/quote]
    I've done both things already and it still says they aren't a valid Qt installation.

    [quote author="sierdzio" date="1335721579"]
    And another question, do you compile Qt yourself, or only Qt Creator? It's not clear from your message, and the steps to solve your problem might differ slightly depending on the answer. Also, I have no experience on BSD, so it might be the case, that it's some BSD-specific issue.[/quote]
    Sorry about that, I am a bit sleepy because I hadn't slept at the moment of making the post.
    I only compile the Qt Creator.

    [quote author="sierdzio" date="1335721579"]
    Probably the best option is to build Qt from sources with "-prefix "$PWD/bin"" and no installation. This way you get a self-contained package, and specifying qmake from bin folder inside qt sources should work.[/quote]
    How would this work? Actually, how can I build it and do the "no installation" part?

    [quote author="sierdzio" date="1335721579"]
    I'm sorry if the post is written a bit chaotically, but I see a lot of possible solutions, and lack enough info to tell you the right one.[/quote]
    Don't worry you have helped a lot


  • Moderators

    [quote author="Jmex" date="1335728001"]
    How would this work? Actually, how can I build it and do the "no installation" part?
    [/quote]

    OK, so we've found at least one path you did not try yet :) You can roughly follow any Qt building instructions, here are ones for 4.8 ("Building Qt4 on x11":http://qt-project.org/doc/qt-4.8/install-x11.html). The key line is the configuration (and setting the $PATH):
    @
    ./configure
    @
    In the link, they use just that, but to get a true in-source build, it's better to go with that:
    @
    unset QTDIR // cleans local env
    export PATH="$PWD/bin" // this ensures that correct qmake is used to build Qt
    ./configure -prefix "$PWD/bin" -release // build in-source (into bin), with release specs only.
    make -j3 // replace '3' with number of cores in your pc + 1
    @

    The "-release" parameter is optional. You can add "-nomake tests -nomake examples -nomake demos" to disable those targets and make it build a bit faster. Full compilation takes, depending on settings, 2-5 hours.

    Now, the important part is NOT to run "make install". With the in-source build that step is not necessary. Of course, that also means that the whole package is "local", and nothing is added to your $PATH.


  • Moderators

    Try running the qmake you want to use in Qt Creator with the "-query" option. Do all the pathes given there look good?



  • [quote author="sierdzio" date="1335763423"]

    OK, so we've found at least one path you did not try yet :) You can roughly follow any Qt building instructions, here are ones for 4.8 ("Building Qt4 on x11":http://qt-project.org/doc/qt-4.8/install-x11.html). The key line is the configuration (and setting the $PATH):
    @
    ./configure
    @
    In the link, they use just that, but to get a true in-source build, it's better to go with that:
    @
    unset QTDIR // cleans local env
    export PATH="$PWD/bin" // this ensures that correct qmake is used to build Qt
    ./configure -prefix "$PWD/bin" -release // build in-source (into bin), with release specs only.
    make -j3 // replace '3' with number of cores in your pc + 1
    @

    The "-release" parameter is optional. You can add "-nomake tests -nomake examples -nomake demos" to disable those targets and make it build a bit faster. Full compilation takes, depending on settings, 2-5 hours.

    Now, the important part is NOT to run "make install". With the in-source build that step is not necessary. Of course, that also means that the whole package is "local", and nothing is added to your $PATH.[/quote]

    thanks a lot, I'll try this as soon as I can

    [quote author="Tobias Hunger" date="1335768224"]Try running the qmake you want to use in Qt Creator with the "-query" option. Do all the pathes given there look good?[/quote]

    Excuse me, I am nothing close to an experienced user, how do I exactly do that?


  • Moderators

    I've just noticed a small bug in the 2nd line of my snipped, here it is corrected:
    @
    export PATH="$PWD/bin:$PATH"
    @


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.