Project

General

Profile

Installing Wt on Cygwin using gcc » History » Version 4

Wim Dumon, 05/18/2011 11:39 PM
remove spam

1 2 Wim Dumon
h1. Install Wt's dependencies
2
3
h2. Cygwin
4
5
From "the cygwin homepage":http://www.cygwin.com/, download setup.exe and install a typical C++ development system.
6
7
IMPORTANT: you need a recent cygwin (1.7+), and you need gcc > 4. At the time of writing of this document, gcc-4 was a separate package in cygwin, whereas the normal gcc package was gcc v3. I installed only gcc-4, and @gcc --version@ reports gcc 4.3.4.
8
9
h2. Get and install boost
10
11
Go to "the boost homepage":http://www.boost.org/ and download the most recent boost version. Build boost following the instructions for the version you downloaded. For example, boost 1.43.0 is compiled and installed in @/cygdrive/j/boost-cygwin@ using the following commands:
12
<pre>
13
./bjam.exe --prefix=/cygdrive/j/boost-cygwin --layout=versioned install
14
</pre>
15
16
Note: Compiling (and installing) boost on cygwin is painfully slow.
17
18
On my system, boost failed to copy the compiled dll's to the correct location. I ran the following command to correct this:
19
<pre>
20
for i in `find . -name \*.dll`; do cp $i /cygdrive/j/boost-cygwin/lib; done
21
</pre>
22
23
Add the directory where you copied these dlls to your PATH environment variable.
24
25 1 Anonymous
h1. Installing Wt on Cygwin using gcc
26 2 Wim Dumon
27
h2. Download Wt
28
29
Download Wt from "the wt download page":http://www.webtoolkit.eu/wt/download. The first version of Wt that attempts to support cygwin is version 3.1.3.
30
31
h2. Configure Wt
32
33
Run cmake. Turns out that cmake's built-in method is unable to discover boost on cygwin, so you need to set BOOST_DIR, BOOST_VERSION and BOOST_COMPILER yourself. Look in the 'lib' directory of the location where you installed boost in the previous step to find out the correct values for BOOST_VERSION and BOOST_COMPILER (e.g. in the examples below, the libraries are called @libboost_wave-gcc43-mt-1_43.a@)
34
35
You must build Wt in a different directory than the source directory:
36
37
<pre>
38
mkdir build
39
cd build
40
cmake -DBOOST_DIR=/cygdrive/j/boost-cygwin -DBOOST_VERSION=1_43 -DBOOST_COMPILER=gcc43 /path/to/wt-x.y.z
41
</pre>
42
43
h2. Build Wt
44
45
Start @make@ in the directory where you ran cmake:
46
<pre>
47
make -j 4
48
</pre>
49
50
h1. Run Wt examples
51
52
Always run examples with the pwd set to their source directory, not from the directory where they are built. Doing so will ensure that Wt will find resource files required to run the example. On top of the example-specific resource files, Wt uses a general 'resources' directory, containing images, css, themes, ... that are required by internal Wt widgets. You must copy them to your example directory before executing the example.
53
54
<pre>
55
cd wt-x.y.z/examples/hello
56
cp -r ../../resources .
57
./hello --docroot=. --http-port=8080 --http-address=0.0.0.0
58
</pre>
59
60
Surf to http://localhost:8080/ and enjoy!
61
62
Some examples have extra dependencies, such as ExtJS (extkitchen, widgetgallery, ...) and tinyMCE (widgetgallery); the FAQ on this wiki explains how to install these.