Check platform on .pro [Solved]



  • Hi all,
    I have a qt project with a .pro file that looks like this:
    @
    QT += core gui
    ...
    ...

    linux-g++ {
    INCLUDEPATH += ../qextserialport_x86
    QMAKE_LIBDIR += ../qextserialport_x86/build
    LIBS += -lqextserialport
    DEFINES = TTY_POSIX
    }
    linux-arm-gnueabi-g++ {
    INCLUDEPATH += ../qextserialport_beagle
    QMAKE_LIBDIR += ../qextserialport_beagle/build
    LIBS += -lqextserialport
    DEFINES = TTY_POSIX
    }
    ...
    ...
    @
    So when I compile for linux desktop (x86) I use some library and when I compile for arm processor I use some other library .

    The problem is that in my notebook after updating the system it seems that "linux-g++" is not recognized as my platform and it doesn't find library.

    What should be the problem?



  • What updates did you do?

    What error messages do you see?

    What is the output of qmake?

    What is the error output of the make process?



  • I know I wasn't so clear but it's difficult to explain better.

    I can try with another question:

    What does it describe the word "linux-g++" or "linux-arm-gnueabi-g++"?
    How can I check if the name of my platform is right?

    I expect that when compiling or cross-compiling my application, the qmake evaluate this:
    @
    linux-g++ {
    INCLUDEPATH += ../qextserialport_x86
    QMAKE_LIBDIR += ../qextserialport_x86/build
    LIBS += -lqextserialport
    DEFINES = TTY_POSIX
    }
    @
    or this:
    @
    linux-arm-gnueabi-g++ {
    INCLUDEPATH += ../qextserialport_beagle
    QMAKE_LIBDIR += ../qextserialport_beagle/build
    LIBS += -lqextserialport
    DEFINES = TTY_POSIX
    }
    @

    How is this done?



  • The labels correspond to the so-called mkspec. Usually there is a directory called mkspecs/default within your Qt installation directory. The default dir is actually a symlink that points at the real mkspec for your system.

    On my Gentoo linux system I have:

    @
    ls -l /usr/share/qt4/mkspecs/default
    lrwxrwxrwx 1 root root 9 Mar 31 11:14 /usr/share/qt4/mkspecs/default -> linux-g++
    @

    so you can see that my default mkspec is linux-g++. What is yours? (NB your mkspecs may well be in a different location to mine).

    If I wanted to compile with a different mkspec for whatever reason (cross-compiling or customised compiler flags etc) then I would specify this on the qmake command line. For example:

    @qmake -spec linux-g++-local@

    is one I use to have custom compiler flags passed in.



  • Ok thanks,
    now it's more clear.

    I check this in my notebook.



  • Thanks to your suggestion I probably solved my problem.

    The problem was that after installing Linux in my notebook I copied qt4 folder from my desktop but during this operation it doesn't keep links so "default" became a directory and not a symlink to linux-g++ .

    Now I tried with rsync to copy from desktop to notebook and it works!!!

    Thanks again.



  • Indeed, scp does not preserve symlinks. I always prefer to use rsync when doing bulk transfers - it can even preserve ACLs too.

    Let us know if you are still having trouble with it once you have had a chance to test it.



  • I tried with both "linux-arm-gnueabi-g++" and "linux-g++" and now it compile without problem.

    Thnaks. :-)



  • You're welcome. I know these build issues can be frustrating.


Log in to reply
 

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