views:

1272

answers:

3

This what I did but it results in errors:

1: In win32-msvc2008\qmake.conf I set QMAKE_CFLAGS_RELEASE = -O1 -Og -GL -MD

2: From MSVC2008 CMD I run vcvarsall.bat x86 and vcvars32.bat "C:\Program Files\Microsoft Visual Studio 9.0\VC\bin

3: From Qt 4.6.2 CMD I run the following

C:\Qt\4.6.2>configure -release -nomake examples -nomake demos -no-exceptions -n o-stl -no-rtti -no-qt3support -no-scripttools -no-openssl -no-opengl -no-webkit -no-phonon -no-style-motif -no-style-cde -no-style-cleanlooks -no-style-plastique -no-sql-sqlite -platform win32-msvc2008 -static -qt-libjpeg -qt-zlib -qt-libpng

and then nmake

However, I ended up every time with these errors:

    link /LIBPATH:"c:\Qt\4.6.2\lib"

/LIBPATH:"c:\Qt\4.6.2\lib" /NOLOGO /INCR EMENTAL:NO /MANIFEST /MANIFESTFILE:"tmp\obj\release_static\assistant_adp.interme diate.manifest" /SUBSYSTEM:WINDOWS "/MANIFESTDEPENDENCY:type='win32' name='Micro soft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df ' language='' processorArchitecture=''" /OUT:......\bin\assistant_adp.exe @C :\DOCUME~1\Geeko\LOCALS~1\Temp\nm3F8.tmp fontpanel.obj : MSIL .netmodule or module compiled with /GL found; restarting li nk with /LTCG; add /LTCG to the link command line to improve linker performance main.obj : error LNK2001: unresolved external symbol "class QObject * __cdecl qt _plugin_instance_qjpeg(void)" (?qt_plugin_instance_qjpeg@@YAPAVQObject@@XZ) ......\bin\assistant_adp.exe : fatal error LNK1120: 1 unresolved externals

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

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

NMAKE : fatal error U1077: 'cd' : return code '0x2' Stop.

NMAKE : fatal error U1077: 'cd' : return code '0x2' Stop.

NMAKE : fatal error U1077: 'cd' : return code '0x2' Stop.

Thank you in deed.

A: 

Try setting these environment variables :

  • QTDIR : c:\Qt\4.6.2 or wherever you unzipped the Qt sources.
  • QMAKESPEC : win32-msvc2008
  • %QTDIR%/bin to the PATH

And use the 'Visual Studio 2008 Command Prompt' (in the Tools menu in VS2008) instead of the Qt one.

gregseth
Thank you for your reply.This is what I've got. It seems there is some progress though :)Any thoughts ?BTE I followed this: http://www.formortals.com/build-qt-static-c1xx : fatal error C1027: Inconsistent values for /Ym between creation and use of precompiled headerqsequentialanimationgroup.cppc1xx : fatal error C1027: Inconsistent values for /Ym between creation and use of precompiled headerqparallelanimationgroup.cppc1xx : fatal error C1027: Inconsistent values for /Ym between creation and use of precompiled headerqpauseanimation.cpp
geeko
The inconsistencies may be caused by object left from a previous compilation. Did you clean up the Qt directory? -- BTW your link leads to a 404 error...
gregseth
Hi again, I tried nmake clean then nmake this time but still:c1xx : fatal error C1027: Inconsistent values for /Ym between creation and use of precompiled headerNMAKE : fatal error U1077: '"c:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.EXE"' : return code '0x2'Stop.NMAKE : fatal error U1077: '"c:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\nmake.exe"' : return code '0x2'Stop.NMAKE : fatal error U1077: 'cd' : return code '0x2'Stop.the website is http://www.formortals.com/build-qt-static-small-microsoft-intel-gcc-compiler/
geeko
Maybe the `nmake clean` isn't just enough, and you need to run `nmake confclean` too -- this will cleanup your makefiles -- then restart from the `configure` step.
gregseth
gregseth:Still with this error:error LNK2001: unresolved external symbol "class QObject * __cdecl qt_plugin_instance_qjpeg(void)" (?qt_plugin_instance_qjpeg@@YAPAVQObject@@XZ)..\..\..\bin\assistant_adp.exe : fatal error LNK1120: 1 unresolved externalsNMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\link.EXE"' : return code '0x460'Stop.NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\nmake.exe"' : return code '0x2'Stop.NMAKE : fatal error U1077: 'cd' : return code '0x2'Stop.
geeko
Any ideas, gurus ? :)
geeko
shall I use vs solution/project files to do it from vs 2008 ?
geeko
A: 

I tried to do it with MS VS 2008 and it worked.

C:\Qt\4.6.2>configure -release -static -opensource -no-fast -no-exceptions -no-accessibility -no-rtti -no-stl -no-opengl -no-openvg -no-incredibuild-xge -no-style-plastique -no-style-cleanlooks -no-style-motif -no-style-cde -no-style-windowsce -no-style-windowsmobile -no-style-s60 -no-gif -no-libpng -no-libtiff -no-libjpeg -no-libmng -no-qt3support -no-mmx -no-3dnow -no-sse -no-sse2 -no-iwmmxt -no-openssl -no-dbus -platform win32-msvc2008 -arch windows -no-phonon -no-phonon-backend -no-multimedia -no-audio-backend -no-script -no-scripttools -webkit -no-declarative

However, I get these errors when building a project that links statically to QWebKit:

1> Creating library C:\Users\Geeko\Desktop\Qt\TestQ\Release\TestQ.lib and object C:\Users\Geeko\Desktop\Qt\TestQ\Release\TestQ.exp

1>QtWebKit.lib(PluginPackageWin.obj) : error LNK2019: unresolved external symbol _VerQueryValueW@16 referenced in function "class WebCore::String __cdecl WebCore::getVersionInfo(void * const,class WebCore::String const &)" (?getVersionInfo@WebCore@@YA?AVString@1@QAXABV21@@Z)

1>QtWebKit.lib(PluginPackageWin.obj) : error LNK2019: unresolved external symbol _GetFileVersionInfoW@16 referenced in function "private: bool __thiscall WebCore::PluginPackage::fetchInfo(void)" (?fetchInfo@PluginPackage@WebCore@@AAE_NXZ)

1>QtWebKit.lib(PluginPackageWin.obj) : error LNK2019: unresolved external symbol _GetFileVersionInfoSizeW@8 referenced in function "private: bool __thiscall WebCore::PluginPackage::fetchInfo(void)" (?fetchInfo@PluginPackage@WebCore@@AAE_NXZ)

1>QtWebKit.lib(PluginDatabaseWin.obj) : error LNK2019: unresolved external symbol _imp_PathRemoveFileSpecW@4 referenced in function "class WebCore::String __cdecl WebCore::safariPluginsDirectory(void)" (?safariPluginsDirectory@WebCore@@YA?AVString@1@XZ)

1>QtWebKit.lib(PluginDatabaseWin.obj) : error LNK2019: unresolved external symbol _imp_SHGetValueW@24 referenced in function "void __cdecl WebCore::addWindowsMediaPlayerPluginDirectory(class WTF::Vector &)" (?addWindowsMediaPlayerPluginDirectory@WebCore@@YAXAAV?$Vector@VString@WebCore@@$0A@@WTF@@@Z)

1>QtWebKit.lib(PluginDatabaseWin.obj) : error LNK2019: unresolved external symbol _imp_PathCombineW@12 referenced in function "void __cdecl WebCore::addMacromediaPluginDirectories(class WTF::Vector &)" (?addMacromediaPluginDirectories@WebCore@@YAXAAV?$Vector@VString@WebCore@@$0A@@WTF@@@Z)

1>C:\Users\Geeko\Desktop\Qt\TestQ\Release\TestQ.exe : fatal error LNK1120: 6 unresolved externals

Do I need to check something in the Qt project options ? I have QtCore, QtGui, Network and WebKit checked.

geeko
Webkit can't be built with static flag!
Viet
Actually I did successfully statically compiled it
geeko
A: 

I also did the same thing but with visual studio,

1)Downloaded and installed the qt opensource version

2)Included the two directories ($QTDIR)\qt\bin,($QTDIR\bin) as path variable in Systemproperties->Environment variable

3)Opened the visual studio 2010 command prompt ->

cd ($QTDIR)\qt\bin

4)nmake distclean

5)configure

6)nmake

the output is:

Creating library ........\lib\QtWebKitd4.lib and object ........\lib\Qt WebKitd4.exp QNetworkReplyHandler.obj : error LNK2001: unresolved external symbol "public: vi rtual struct QMetaObject const * __thiscall WebCore::FormDataIODevice::metaObjec t(void)const " (?metaObject@FormDataIODevice@WebCore@@UBEPBUQMetaObject@@XZ) QNetworkReplyHandler.obj : error LNK2001: unresolved external symbol "public: vi rtual void * __thiscall WebCore::FormDataIODevice::qt_metacast(char const *)" (? qt_metacast@FormDataIODevice@WebCore@@UAEPAXPBD@Z) QNetworkReplyHandler.obj : error LNK2001: unresolved external symbol "public: vi rtual int __thiscall WebCore::FormDataIODevice::qt_metacall(enum QMetaObject::Ca ll,int,void * *)" (?qt_metacall@FormDataIODevice@WebCore@@UAEHW4Call@QMetaObject @@HPAPAX@Z) QNetworkReplyHandler.obj : error LNK2001: unresolved external symbol "public: vi rtual struct QMetaObject const * __thiscall WebCore::QNetworkReplyHandler::metaO bject(void)const " (?metaObject@QNetworkReplyHandler@WebCore@@UBEPBUQMetaObject@ @XZ) QNetworkReplyHandler.obj : error LNK2001: unresolved external symbol "public: vi rtual void * __thiscall WebCore::QNetworkReplyHandler::qt_metacast(char const *) " (?qt_metacast@QNetworkReplyHandler@WebCore@@UAEPAXPBD@Z) QNetworkReplyHandler.obj : error LNK2001: unresolved external symbol "public: vi rtual int __thiscall WebCore::QNetworkReplyHandler::qt_metacall(enum QMetaObject ::Call,int,void * *)" (?qt_metacall@QNetworkReplyHandler@WebCore@@UAEHW4Call@QMe taObject@@HPAPAX@Z) QNetworkReplyHandler.obj : error LNK2019: unresolved external symbol "protected: void __thiscall WebCore::QNetworkReplyHandler::processQueuedItems(void)" (?proc essQueuedItems@QNetworkReplyHandler@WebCore@@IAEXXZ) referenced in function "pub lic: void __thiscall WebCore::QNetworkReplyHandler::setLoadMode(enum WebCore::QN etworkReplyHandler::LoadMode)" (?setLoadMode@QNetworkReplyHandler@WebCore@@QAEXW 4LoadMode@12@@Z) FrameLoaderClientQt.obj : error LNK2019: unresolved external symbol "protected: void __thiscall QWebPage::unsupportedContent(class QNetworkReply *)" (?unsupport edContent@QWebPage@@IAEXPAVQNetworkReply@@@Z) referenced in function "public: vi rtual void __thiscall WebCore::FrameLoaderClientQt::download(class WebCore::Reso urceHandle *,struct WebCore::ResourceRequest const &,struct WebCore::ResourceReq uest const &,class WebCore::ResourceResponse const &)" (?download@FrameLoaderCli entQt@WebCore@@UAEXPAVResourceHandle@2@ABUResourceRequest@2@1ABVResourceResponse @2@@Z) FrameLoaderClientQt.obj : error LNK2019: unresolved external symbol "protected: void __thiscall QWebPage::downloadRequested(class QNetworkRequest const &)" (?do wnloadRequested@QWebPage@@IAEXABVQNetworkRequest@@@Z) referenced in function "pu blic: virtual void __thiscall WebCore::FrameLoaderClientQt::startDownload(struct WebCore::ResourceRequest const &)" (?startDownload@FrameLoaderClientQt@WebCore@ @UAEXABUResourceRequest@2@@Z) ........\lib\QtWebKitd4.dll : fatal error LNK1120: 9 unresolved externals NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 10.0\VC\BI N\link.EXE"' : return code '0x460' Stop. NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 10.0\VC\BI N\nmake.exe"' : return code '0x2' Stop. NMAKE : fatal error U1077: 'cd' : return code '0x2' Stop.

Is there anybody to help me out,, I am trying to install this for the pat three days

prabhakaran