Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Wrong (standard) path is used in makefiles
Forum Updated to NodeBB v4.3 + New Features

Wrong (standard) path is used in makefiles

Scheduled Pinned Locked Moved Solved General and Desktop
10 Posts 3 Posters 3.1k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    InvalidUsername
    wrote on last edited by InvalidUsername
    #1

    I want to install QT and then compile a project. In order to do so, I download QT, execute configure, build it, use qmake in my project and then compile.

    Problem is that the makefile of my project contains a wrong reference to the standard QT path:

    INCPATH = -I../../qt-everywhere-opensource-src-4.8.6/mkspecs/linux-g++ -I. -I/usr/local/Trolltech/Qt-4.8.6/include/QtCore (...and some more)

    The first path is the correct one, the second path is the standard QT path, which in my case is not valid (and I don't have writing privileges there).
    As a result, nothing of the QT library is found.

    I checked all relevant environment variables (PATH, QTDIR, QMAKESPEC, QTINC, QTLIB, QMAKE_RPATHDIR, QT_PLUGIN_PATH, QT_INSTALL_PREFIX) and they are just fine. Since the invalid directory does not exist, I hadn't expected the wrong path in there anyway.
    I also made sure to call qmake directly by full path when creating the makefile. The project file does not contain any QT related paths.

    Reading the makefile of QT itself, it sounds as if it tries to install something under /usr/local/Trolltech/. Is that the problem? That the QT configure wants to install there but can't due to missing writing privileges?
    If so, how to fix this? If not, what else can be the problem here? Any more specific information needed, like my configure parameters?

    (Not interested in the solution of changing the makefile here, I want qmake to create valid makefiles.)
    (The old QT version is on purpose, by the way. Compiling some old code here.)

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      What distro ?
      Anyway, i had somewhat same issue in Mint and used
      qt5-default
      and the qtchooser

      But you are not saying what is old Qt and what is new :)
      4.8 is new ?

      Not sure qt5-default works with 4.x branch. never tried it.

      I 1 Reply Last reply
      0
      • mrjjM mrjj

        What distro ?
        Anyway, i had somewhat same issue in Mint and used
        qt5-default
        and the qtchooser

        But you are not saying what is old Qt and what is new :)
        4.8 is new ?

        Not sure qt5-default works with 4.x branch. never tried it.

        I Offline
        I Offline
        InvalidUsername
        wrote on last edited by
        #3

        @mrjj Red Hat. The QT is use is version 4.8.6.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi and welcome to devnet,

          Out of curiosity, since you are using a Qt4, why not use your distribution provided Qt for development ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          I 1 Reply Last reply
          0
          • SGaistS SGaist

            Hi and welcome to devnet,

            Out of curiosity, since you are using a Qt4, why not use your distribution provided Qt for development ?

            I Offline
            I Offline
            InvalidUsername
            wrote on last edited by
            #5

            @SGaist I have some working Qt available elsewhere, but my current task is to create a shell script that does a full routine of downloading a project and all it's dependencies, including Qt, and then build it from scratch. This one should work on any Linux distribution (at least that's the idea).
            Qt4 is the newest Qt version that builds the project - some of the dependencies got old code that won't work with Qt5.
            Before that, I did the same with a batch file in Windows, which works fine right now.

            (Before anyone asks, yes, I made sure to swap out the Qt download for Linux and to change the configure parameters accordingly.)

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              What parameters did you pass to configure when building Qt yourself ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              I 1 Reply Last reply
              0
              • SGaistS SGaist

                What parameters did you pass to configure when building Qt yourself ?

                I Offline
                I Offline
                InvalidUsername
                wrote on last edited by
                #7

                @SGaist I started with those:
                -no-qt3support -no-opengl -no-phonon -no-phonon-backend -no-multimedia -no-audio-backend -no-webkit -no-declarative -nomake demos -nomake examples -nomake docs -nomake translations -debug-and-release -platform linux-g++ -static -qt-libjpeg -no-libtiff -no-openvg -no-gif -no-libpng -no-libmng -no-libjpeg -no-mmx -no-3dnow -no-sse -no-openssl -no-dbus -no-script -no-scripttools -no-declarative-debug
                But I also tried without any parameters at all.

                That said, can't imagine that any parameters will result in an invalid path to be used.

                That said, I used Qt as found on
                https://download.qt.io/archive/qt/4.8/4.8.6/qt-everywhere-opensource-src-4.8.6.tar.gz
                Probably not relevant either, but in case if anyone should want to know.

                To make sure, I also compiled Qt on a single thread.

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  Can you share the part of your script where you prepare and use Qt ?

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  I 1 Reply Last reply
                  0
                  • SGaistS SGaist

                    Can you share the part of your script where you prepare and use Qt ?

                    I Offline
                    I Offline
                    InvalidUsername
                    wrote on last edited by InvalidUsername
                    #9

                    @SGaist I also did this by hand to make sure that the problem is not based on the script, but here you go:

                    At the very head:

                    qtfolder=qt-everywhere-opensource-src-4.8.6
                    root=${PWD}
                    compilesuffix=""
                    

                    (compilesuffix contains the options for make and will later be set to " -j")

                    Somewhat later, to make sure that the environment variables are correct within the script for certain:

                        export PATH=$root/$qtfolder/bin:$root/$qtfolder:$PATH
                        export QTDIR=$root/$qtfolder
                        export QMAKESPEC=$root/$qtfolder/mkspecs/linux-g++
                        export QTINC=$root/$qtfolder/include
                        export QTLIB=$root/$qtfolder/lib
                        export RPATH=$root/$qtfolder/lib
                        export QMAKE_RPATHDIR=$root/$qtfolder/lib
                        export QT_PLUGIN_PATH=$root/$qtfolder/plugins
                        export QT_INSTALL_PREFIX=$root/$qtfolder
                    

                    and finally

                    handle_qt() {
                    
                            echo "configuring QT"
                            cd $qtfolder
                            dir
                            ./configure -no-qt3support -no-opengl -no-phonon -no-phonon-backend -no-multimedia -no-audio-backend -no-webkit -no-declarative -nomake demos -nomake examples -nomake docs -nomake translations -debug-and-release -platform linux-g++ -static -qt-libjpeg -no-libtiff -no-openvg -no-gif -no-libpng -no-libmng -no-libjpeg -no-mmx -no-3dnow -no-sse -no-openssl -no-dbus -no-script -no-scripttools -no-declarative-debug
                            cd $root
                            echo "configure complete"
                            echo ""
                    
                            echo "compiling QT"
                            echo ""
                            cd $qtfolder
                            $root/$makefolder/make$compilesuffix
                            cd $root
                            echo "compilation complete"
                            echo ""
                    }
                    

                    Later on, qmake is called like

                        $root/$qtfolder/bin/qmake
                    

                    (And again, I also tried this with no configure parameters, same problem.)

                    1 Reply Last reply
                    0
                    • I Offline
                      I Offline
                      InvalidUsername
                      wrote on last edited by
                      #10

                      Solved it on my own, simply used the -prefix configure parameter.

                      1 Reply Last reply
                      1

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved