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. Qt.conf
QtWS25 Last Chance

Qt.conf

Scheduled Pinned Locked Moved General and Desktop
11 Posts 3 Posters 6.9k Views
  • 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.
  • G Offline
    G Offline
    GrahamL
    wrote on last edited by
    #1

    Hi
    I am trying to use the qt.conf functionality
    In my qt.conf file I have the following

    [Paths]
    prefix = "C:\Program Files (x86)\AcquisitionSoftware\Qt"

    Running the app through the debugger I can use QLibraryInfo to verify that Qt is recognising the presence of the conf file

    I.e.
    QLibraryInfo::location(QLibraryInfo::LibrariesPath) returns C:/Program Files (x86)/AcquisitionSoftware/Qt/lib

    However running the application on a machine without Qt installed fails as it cannot locate QCore4.dll

    Note that on the target machine the folder C:/Program Files (x86)/AcquisitionSoftware/Qt/lib exists and contains QCore4.dll

    Is this a known problem or am I doing something incorrectly?

    Thanks

    1 Reply Last reply
    0
    • F Offline
      F Offline
      favoritas37
      wrote on last edited by
      #2

      The QCore4.dll must be in the same directory with the executable. From what i can understand from your paths, you place it to an other folder, right?

      1 Reply Last reply
      0
      • G Offline
        G Offline
        GrahamL
        wrote on last edited by
        #3

        I thought that by using qt.conf that I could have the qt libraries in an alternative folder specified in the conf file.
        Is this a misunderstanding on my part?

        1 Reply Last reply
        0
        • F Offline
          F Offline
          favoritas37
          wrote on last edited by
          #4

          Yes you can, but the .dll files are binaries, so you need to place them where the QLibraryInfo::BinariesPath points.

          So add your .dlls to a bin folder and propably you will be fine.

          1 Reply Last reply
          0
          • G Offline
            G Offline
            GrahamL
            wrote on last edited by
            #5

            I have placed QCore4.dll and QGui4.dll in
            C:/Program Files (x86)/AcquisitionSoftware/Qt/bin

            But running the application I still get an error stating it cannot find QCore4.dll

            Is there anything else I can try?

            1 Reply Last reply
            0
            • F Offline
              F Offline
              favoritas37
              wrote on last edited by
              #6

              The .exe file of your application in which folder is it placed?
              Is it in C:/Program Files (x86)/AcquisitionSoftware ?

              Because if it is there then yes, it is logical that it cant find it since it searches the bin folder with relative path to the path of the executable. So it will search in C:/Program Files (x86)/AcquisitionSoftware/bin which doesn't exist.

              So still assuming that your executable is C:/Program Files (x86)/AcquisitionSoftware you need to write in qt.conf something like the following:

              @
              [Paths]
              Binaries = Qt/bin
              @

              1 Reply Last reply
              0
              • G Offline
                G Offline
                GrahamL
                wrote on last edited by
                #7

                This is what I have -
                in C:/Program Files(x86)/AcquisitionSoftware/

                @Acq.exe (the application)
                qt.conf
                Qt
                bin
                QtCore4.dll
                QtGui4.dll
                @

                contents of qt.conf are
                @
                [Paths]
                Binaries=Qt/bin
                @

                But it still wont run

                ??

                1 Reply Last reply
                0
                • L Offline
                  L Offline
                  lgeyer
                  wrote on last edited by
                  #8

                  You will have to place the DLLs in one of the "default search paths":http://goo.gl/FNXv9.

                  1 Reply Last reply
                  0
                  • G Offline
                    G Offline
                    GrahamL
                    wrote on last edited by
                    #9

                    Ok
                    but what then is the pint of the qt.conf file?
                    is the situation the same on linux?

                    1 Reply Last reply
                    0
                    • L Offline
                      L Offline
                      lgeyer
                      wrote on last edited by
                      #10

                      You cannot expect the application to start up and read qt.conf where to locate all the dependencies that are required to start up. ;-) Especially if the code to do so is in the libraries you are trying to locate.

                      When dynamically linking against a library the application itself does not contain any code of the library. The dynamic linker of the operating system is responsible for locating the referenced libraries at the time the application starts up. The dynamic linker has no idea of Qt or qt.conf, it just knows that application X requires library Y to start up.

                      The qt.conf file is suitable for overriding stuff that is otherwise hardcoded in the libraries itself, for example where to find translations, documentation or libraries not required to startup.

                      Linux mainly uses LD_LIBRARY_PATH and linker options to set paths to shared libraries; Google will give you a more detailed answer.

                      Anyway, the main idea behind shared libraries is that they are not delivered with every application but there is a single system-wide installation which is used by every application.

                      1 Reply Last reply
                      1
                      • G Offline
                        G Offline
                        GrahamL
                        wrote on last edited by
                        #11

                        Ok thanks
                        Things are a little clearer now
                        Thank-you for your patience!

                        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