[Interest] qt.conf

637 views
Skip to first unread message

Graham Labdon

unread,
Mar 20, 2012, 5:44:08 AM3/20/12
to inte...@qt-project.org

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

Diego Iastrubni

unread,
Mar 20, 2012, 6:02:06 AM3/20/12
to Graham Labdon, inte...@qt-project.org
That is because your code has not been called yed. The win32 loader cannot find the DLLs needed.

Solution:
Write a wrapper application that sets parses the .conf file, set PATH correctly and then starts the application. The startup APP must not depend on any DLLs not provided by the OS or have the DLLs on the same dir.

Solution 2:
Move the DLLs to the application directory on windows.

Solution 3:
Does win32 support something like rpath on unix?

Graham Labdon

unread,
Mar 20, 2012, 6:11:05 AM3/20/12
to Diego Iastrubni, inte...@qt-project.org

This does not seem to be explained in the Qt documentation

Reading that implies that the qt.conf can be used to point the application to the location of the qt libraries

Graham Labdon

unread,
Mar 20, 2012, 6:49:58 AM3/20/12
to Tony Rietwyk, inte...@qt-project.org

Thanks for your reply

Does this imply that qt.conf cannot be used with windows?

Is this situation the same on Linux?

What CAN qt.conf be used for?

 

Thanks

 

From: Tony Rietwyk [mailto:to...@rightsoft.com.au]
Sent: 20 March 2012 10:40
To: Graham Labdon
Subject: RE: [Interest] qt.conf

 

Hi Graham,

 

Windows doesn’t know anything about the qt.conf file.  So the Qt code itself has to be running before it can read the file.  When you install on another machine, you can add the lib path to the PATH variable, or copy the lib dll’s into the exe’s folder, or use a script file to setup the environment and call your exe, or…..

 

Hope that helps,

 

Tony.

 

 

Sent: Tuesday, 20 March 2012 8:44 PM

Hugo Drumond Jacob

unread,
Mar 20, 2012, 7:27:23 AM3/20/12
to inte...@qt-project.org
Hello Graham!

On Windows, you can add the Qt library path (directory with .DLL files) to the environment path (PATH environment variable).

The qt.conf file is used only after your application starts. Before this, Windows need to know all .DLL files used by your program (like ldconfig on Linux).

If you don't know how try this, see http://www.computerhope.com/issues/ch000549.htm to reference.

Regards,

Hugo Drumond Jacob


2012/3/20 Graham Labdon <Graham...@avalonsciences.com>
_______________________________________________
Interest mailing list
Inte...@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Bo Thorsen

unread,
Mar 20, 2012, 8:21:20 AM3/20/12
to inte...@qt-project.org
Hi Graham,

Den 20-03-2012 11:49, Graham Labdon skrev:
> Does this imply that qt.conf cannot be used with windows?

No it doesn't. But it can't do what you want it to do. You're trying to
use the wrong tool for the problem.

> Is this situation the same on Linux?

Yes it is.

> What CAN qt.conf be used for?

I told you last week, it's for the place of plugins, images,
translations etc. It's not for the libraries linked to by the linker.
The linker on Windows (as well as linux or Mac) has no clue about qt.conf.

QtCore4.dll and the others are linked to the application on startup time.

You have to place the Qt dll files in the same folder as your
application binary. Or set the right lib environment variable.

Bo Thorsen,
Fionia Software.

--

Expert Qt and C++ developer for hire
Contact me if you need expert Qt help
http://www.fioniasoftware.dk

Andreas Pakulat

unread,
Mar 20, 2012, 8:23:56 AM3/20/12
to inte...@qt-project.org
On 20.03.12 10:49:58, Graham Labdon wrote:
> Thanks for your reply
> Does this imply that qt.conf cannot be used with windows?

Sure it can be used, just not for what you want to do.

> Is this situation the same on Linux?

Yes, the dynamic linker runs before qt is being loaded and hence nothing
is able to read qt.conf

> What CAN qt.conf be used for?

To configure the plugin locations and to make Qt itself relocatable
(i.e. moving a Qt build from one place to another requires either patching
the binaries or a qt.conf file).

Andreas

Tony Rietwyk

unread,
Mar 20, 2012, 9:17:43 AM3/20/12
to inte...@qt-project.org

Hi Graham,

 

As others have confirmed, the libs library path set in qt.conf cannot be used to redirect where Qt is loaded from – worse, it may not have any relationship to the running dll’s!   

 

If the defaults of the other locations (like plugins) works for you, then there is no need to install the qt.conf file at all.  ;O)

 

Regards.

Reply all
Reply to author
Forward
0 new messages