PDA

View Full Version : Deployment of Static Qt on Windows?



merry
17th July 2008, 09:50
Hi all

Working on Qt 4.3.4 on windows using Microsoft Visual Studio 5? I am using dynamic version of Qt, Now i want to build it statically, Pls explain me the steps to build Qt Statically.

jpn
17th July 2008, 12:31
Are you referring to the tool released somewhere in the mid 90's? Or did you mean Visual Studio 2005? Have you tried searching the forums? This question has been asked quite many times...

merry
17th July 2008, 12:44
I mean Visual Studio 2005, yaa i tried searching and i got the answer.....and also implemented....can u pls tell me , how much time taken for building Qt static.

merry
19th July 2008, 06:02
After deploying Static Qt4.3.4, I tried to compile my application in release mode using static Qt...i got some fatal errors:


NMAKE : fatal error U1077: ' "C:\Program Files\Microsoft Visual Studio 8\VC\BIN\LINK.EXE"' : return code '0x460'
Stop

NMAKE : fatal error U1077: ' "C:\Program Files\Microsoft Visual Studio 8\VC|BIN\Nmake.exe"' : return code '0x2'
Stop

why i got these errors and what to do?

jpn
20th July 2008, 19:44
What is the first error message?

merry
21st July 2008, 05:42
first error:

e
rror LNK2019 : unresolved external symbol "class QObject * __cdec1 qt_plugin_instance_qjpeg<void>" <?qt_plugin_instance_qjpeg@@YAPAVQObject@@XZ> referenced in function "public:__thiscall Static qjpegPluginInstance::staticqjpegPluginInstance::St aticqjpegPluginInstance<void>"<??0StaticqgifPluginIstance@@QAE@XZ>

error LNK2019 : unresolved external symbol "class QObject * __cdec1 qt_plugin_instance_qgif<void>" <?qt_plugin_instance_qgif@@YAPAVQObject@@XZ> referenced in function "public:__thiscall Static qgifPluginInstance::staticqgifPluginInstance::Stat icqgifPluginInstance<void>"<??0StaticqgifPluginIstance@@QAE@XZ>


error LNK2019 : unresolved external symbol "class QObject * __cdec1 qt_plugin_instance_qtiff<void>" <?qt_plugin_instance_qtiff@@YAPAVQObject@@XZ> referenced in function "public:__thiscall Static qtiffPluginInstance::staticqgifPluginInstance::Sta ticqtiffPluginInstance<void>"<??0StaticqtiffPluginIstance@@QAE@XZ>

ChristianEhrlicher
21st July 2008, 07:09
You forgot to link to your staitc plugins: http://doc.trolltech.com/4.3/plugins-howto.html#static-plugins

jpn
21st July 2008, 07:09
Static Plugins (http://doc.trolltech.com/4.4/plugins-howto.html#static-plugins)

biswajithit
21st July 2008, 07:52
Hi,

do onething,

try to install qt using cmd.

./configure -static -qt-gif -qt-jpeg

NMAKE

NOTE:Check the error . it will tell you to use that particular qt library instead of normal library.

:rolleyes: enjoy


regards
Biswajit

merry
21st July 2008, 07:53
You forgot to link to your staitc plugins


No I wont forgot to link to my static plugins

in .pro file I added

QTPLUGIN +=qjpeg qgif qtiff

in main.cpp I define all plugins:;

Q_IMPORT_PLUGIN(qjpeg)
Q_IMPORT_PLUGIN(qgif)
Q_IMPORT_PLUGIN(qtiff)

merry
21st July 2008, 07:55
Thanks 4 replies

Ok i ll try to install qt using cmd and let u know

ChristianEhrlicher
21st July 2008, 08:26
Then you forgot to rerun qmake or something like this. You definitely don't link against static qjpeg plugin - otherwise you won't get those linker errors!

merry
21st July 2008, 10:09
now i added

config += static in the plugin.pro file , then it doesnt return the previous error but generates some other linking error


LINK : fatal error LNK1104: cannot open file 'c:\Qt\Qt4.3.4l\lib\QtGuid.lib'
NMAKE : fatal error U1077: ' "C:\Program Files\Microsoft Visual Studio 8\VC\BIN\LINK.EXE"' : return code '0x450'
Stop

NMAKE : fatal error U1077: ' "C:\Program Files\Microsoft Visual Studio 8\VC|BIN\Nmake.exe"' : return code '0x2'
Stop

but with the same it generates the manifest file and exe of my application and exe also runs fine.