Qt.conf



  • 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



  • 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?



  • 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?



  • 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.



  • 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?



  • 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
    @



  • 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

    ??



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



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



  • 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.



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


Log in to reply
 

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