Qt Webkit Win32 Build Instructions

From Second Life Wiki
Revision as of 10:56, 6 February 2009 by Icefox Carrasco (talk | contribs)
Jump to navigation Jump to search

These are instructions for building the Qt/WebKit library as well as testgl and uBrowser demo apps using WebKit.

If you do not have git, you can download and install from:

http://code.google.com/p/msysgit/

Select the option (number 2 of 3) to add git to your path, but not all the unix tools that ship with it.

1) Building the open source Qt snapshot with Visual Studio:

  • 1.1) Set up directories
  • Start/All Programs/Microsoft Visual Studio 2005/Visual Studio Tools/Visual Studio 2005 Command Prompt
mkdir C:\Qt
  • 1.2) Clone a copy of Qt - about 500 MB
cd C:\Qt
git clone git://labs.trolltech.com/qt-snapshot
  • 1.3) Configure Qt, takes about 10 minutes:
cd qt-snapshot
configure -release -no-qt3support -prefix C:\Qt\qt-snapshot
  • When the license agreement appears, if you agree type:
  • y<enter>
  • 1.4) Build Qt, without demos. This takes 1-2 hours.
nmake sub-src
  • After building Qt the release and debug libraries will be in C:\Qt\qt-snapshot\lib
  • 1.5) Create the file C:\Qt\qt-snapshot\bin\qt-vars.bat and put the following in it
@echo off
echo Setting up a Qt environment...
set QTDIR=C:\Qt\qt-snapshot
set PATH=C:\Qt\qt-snapshot\bin;%PATH%
set QMAKESPEC=win32-msvc2005
call "C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\vsvars32.bat"
  • 1.6) Make a shortcut to qt-vars.bat on your desktop

Right-click > Properties on the shortcut and set: Target: %COMSPEC% /k "C:\Qt\qt-snapshot\bin\qt-vars.bat" Start in: C:\Qt\qt-snapshot

Rename the command prompt shortcut to "Qt Snapshot Command Prompt.

You can test it by opening the prompt and typing qmake --version.


2) Acquire llmozlib 2.1) Run "Qt Snapshot Command Prompt" and go to "C:\"

2.2) Checkout the qtwebkit branch

  • git checkout -f -b qtwebkit origin/qtwebkit

3) Build llmozlib.a 3.1) Launch the Qt command prompt

  • cd C:\llmozlib\llmozlib2
  • qmake
  • nmake

3) Acquire test dependencies

a. Glut: http://www.xmission.com/~nate/glut.html  Grab the library and header zip.
a1. Extract the contents of the zip to a c:\llmozlib\llmozlib2\tests\GL
b. Glui32: http://glui.sourceforge.net/
b1. Extract the zip
b2. Open glui\src\msvc\glui.vcproj.  Allow Visual Studio to convert the project.
b2. Edit src\include\GL\glut.h
b3. Move "#include <cstdlib>" to the top of the file, just under #define GLUI_GLUI_H
    (hence above #include <GL/glut.h>
b4. See http://www.lighthouse3d.com/opengl/glut/ for details on this edit
b5. Follow the instructions in the readme.txt to compile the library
    Make sure to build a release library
b6. Copy glui.h and from the include into C:\llmozlib\llmozlib2\tests\GL
b7. Copy glui32.lib from msvc/lib into C:\llmozlib\llmozlib2\tests\GL

4) Build testgl and run it

  • cd C:\llmozlib\llmozlib2\tests\testgl
  • qmake CONFIG-=debug
  • nmake
  • ..\GL\testgl.exe

5) Build ubrowser and run it

  • cd C:\llmozlib\llmozlib2\tests\ubrowser
  • qmake CONFIG-=debug
  • nmake
  • ..\GL\ubrowser.exe

Notes: a.To use Visual studio 2005, under qt *commercial* command prompt to get a .vcproj, run

 qmake -tp vc

b. Make sure all libs and app are built as Multi-threaded Dll or Multi-threaded debug dll.

In Visual Studio this is in Properties->configuration->c/c++->code generation->runtime library

Troubleshooting: 1) If you see this, you need to reorder the <cstdlib> and <GL/glut.h> includes.

C:\Program Files\Microsoft Visual Studio 8\VC\include\stdlib.h(406) : error C2381: 'exit' : redefinition; __declspec(noreturn) differs

       ../include\GL/glut.h(146) : see declaration of 'exit'

2) uBrowser crashes on startup in stdlib (vc8crt.dll or similar)

This happens when you mix debug and release libraries. Make sure you are using all "release" builds of GLUI and ubrowser.