views:

3677

answers:

3

I'm trying to get my Visual Studio Qt plug-in to work, so to recompile the Qt libraries i ran the following commands from a VS command prompt:

c:\*Qtfolder*>configure -platform -win32-msvc2008

After this I ran nmake and started the compilation process. It went for about 45 minutes before aborting due to linking errors. I got a total of eight "unresolved external symbol" errors, all from QNetworkReplyHandler.obj and FrameLoaderClientQt.obj. Neither of these are libraries that I need, but the compilation is being aborted due to their errors. When it does abort the rest of the libraries seem to be almost done, in fact I can even load and compile my Qt projects in Visual Studio at this point, they just runny buggy due most likely to not all of the libraries being compiled. Has anyone run into this or maybe know why nmake is failing?

It seems like if I could either tell the compiler to keep going in spite of the errors or to omit the offending libraries it might work. Qt's configure has a lot of options but I can't find any that do what I need, and unfortunately I can't find an online reference of Qt's configure options, everything that comes up with a google search is for "Qtopia" for some reason.

Here is the last error. There are seven more that are basically exactly the same error, just for different symbols

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: 8 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.
+2  A: 

Not sure if this will help but here are the configure options I used to successfully build Qt 4.5 for Visual Studio Express 2008 on Vista:

C:\Qt\2009.01\configure -no-sql-sqlite -no-qt3support -no-opengl -platform win32-msvc2008 -no-libtiff -no-dbus -no-phonon -no-phonon-backend -no-webkit

I got that from this Qt 4.5 with Visual Studio 2008 (VC++ Express) HowTo.

Make sure to follow all of the instructions there in order to get the examples to build in VS.

Karl Voigtland
That is one of the main references I used, I've tried playing with the command line parameters for configure.exe but they all give the same result, nmake fails with the same linking errors.
Graphics Noob
+4  A: 

Apparently you can get around this particular error by deleting the two instances of mocinclude.tmp in src/3rdparty/webkit/WebCore/tmp/moc/{debug,release}_shared. (Source).

As an aside, when you run configure you can pass a 'help' argument to it to get a list of arguments it understands (i.e. configure help).

richardwb
Thanks I'll give that a try. I've seen the configure help on my machine, it's just that I couldn't find an online reference to link to. I ended up trying using the /K option for nmake to continue after the errors but I got the same problem.
Graphics Noob
This solution worked best. If you do the -no-webkit option it compiles successfully, but when you try to import your Qt projects to VS it fails with an "incompatible Qt libraries" (or something like that) error.
Graphics Noob
+1  A: 

I browsed the Qt forum after reading richardwb's answer and found another proposed solution which is to run configure with the -no-webkit option to skip the offending library. The final configure command would look like this

configure -no-webkit -platform win32-msvc2008

I'm going to try this and richardwb's solution and update when I'm done

Graphics Noob