visual studio 2010 - Qt installation directory woes -


i want use qt in new project. installer target compiler (vs2010 64bit), not exist.

i using windows 7 64-bit qt 5.1.1.

a colleague of mine planning on using qt , has managed compile target compiler (which uses well). has built in directory, dira. graciously gives me copy of entire qt sdk build (binaries, examples, headers, , all), , copy dirb on machine.

i need in dirb, because 3rd party libraries installed, , cmake scripts know how find them. added qt bin folder path.

problems ensue. qt binaries reason have install path (in case build path) hard coded within them. though qt bin folder in path (so dlls found), qt's dll(s) looking in wrong place windows "plugin". looking in dira, not exist on machine.

so found researching, using qt.conf file specifying install path root, supposed way go. add 1 qt bin dir, , qt binaries (assistant, qmake, etc) can run.

but build 1 of examples. builds fine. run exe, qt dlls load, , crashes because can't find plugin directory.

a work-around colleague , found seems work, copy qt.conf file directory exe resides in. after doing exe runs.

but not seem right. exe can find qt dlls, qt dlls loads can't find qt.conf. don't know in own containing folder. must have qt.conf in working directory (my exe dir) found , used.

does know why might happening, , know of way me not forced have qt.conf file in exe's dir? can't accept requires rebuild of qt. there must other way.

you can put qt.conf into binary. using resource system.

from qt docs:

without qt.conf, qt libraries use hard-coded paths plugins, translations, , on. these paths may not exist on target system, or may not accesssible. because of this, need qt.conf make qt libraries elsewhere.

qlibraryinfo load qt.conf 1 of following locations:

:/qt/etc/qt.conf using resource system 

or:

using qapplication::addlibrarypath() or qapplication::setlibrarypaths(). approach recommended if have 1 executable use plugin.

if add custom path using qapplication::addlibrarypath this:

qapp->addlibrarypath("c:/custompath/plugins");


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -