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/libHowever 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?
-
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.
-
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
@ -
You will have to place the DLLs in one of the "default search paths":http://goo.gl/FNXv9.
-
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.