How to install Wt (Witty) on Windows

Installing Wt can be a challenging task if you don’t have the right tools. I spent many days trying to make it work with MinGW and Visual Studio 2005. No luck. Here are some of my results:

MinGW

I was never able to make a full compile. It was interrupted by this or that reason. I could never get any of the examples to work.

Visual C++ Express 2005

Some of the examples worked, however only in “Release” mode. They never worked in debug mode, even though they compiled and linked successfuly. The INSTALL project didn’t work ethier.

Visual C++ Express 2008

Back to the honey moon… It worked perfect. The full process to make it work is described next.

 

Installing Requirements

1. You need a working copy of Microsoft Visual C++ Express 2008. You can download the Microsoft Visual Studio 2008 Express Edition from the Microsoft Visual Studio Express 2008.

I highly recommend you to create and run a basic Hello World program just to make sure your installation works.

2. Now download Wt from the Wt website. I downloaded version 3.2.2-p1. Unzip it to your hard disk.

3. You have to get the Boost Libraries. That is the only required library by Wt. Plus they are very helpful. You can download a Boost precompiled binary version from the Boostpro website. I’m doing this installation using version 1.47. During the installation you will be prompted to select the libraries you want to download. I recommend you to get all the multithreaded versions to avoid problems.

boost-libraries-1

boost-libraries-2

boost-libraries-3

4. CMake is the last requirement. It is needed to create the configuration file for Wt. It is simple to use and all of the options are presented on a nice window. You can get it from the CMake website. For this exercise I will use version 2.8. During the installation you will be prompted to add the CMake application to the system path, but this is not necessary.

cmake-1

cmake-2

Everything is installed. Now it’s time to create the configuration files.

 

Configuration

Go to Start > All Programs > CMake 2.8 > CMake (cmake-gui)

Set the Where is the source code: value by pressing the Browse Source button and looking for the folder where you unzipped Wt.
Next, set the Where to build the binaries: to the value of the last field, and add /build to the end. /build is the recommended folder where all your files will be compiled to.
Now press the Configure button.

cmake-3

cmake-3.5

You will get “many” errors. This is correct. Most of them are related to the Boost library. Look for the following variables and change the values as follows:

BOOST_PREFIX = C:/opt/cpp/boost/boost_1_47
WT_NO_BOOST_RANDOM = false

 

  • BOOST_PREFIX has to point to your boost installation folder. It can contain spaces, and by default should be something like C:/Program Files/boost/.
  • WT_NO_BOOST_RANDOM should be false for Boost versions newer than 1.45. On that version, Boost changed some of its interfaces, so this is an important property.

 

Update: Another error you might encounter in CMake is “The C compiler “cl” is not able to compile a simple test program.” This means that your Visual Studio won’t find ‘cmd’ as it isn’t configured correctly.

What you must do is change the Microsoft Visual C++ options (Tools menu > Options > Project and Solutions > VC++ Directories) to ensure that

  • $(SystemRoot)
  • $(SystemRoot)System32
  • $(SystemRoot)System32wbem

are specified BEFORE $(PATH).

 

cmake-4

cmake-5

Press the Configure button again. This time you should see less errors. Press it again.

cmake-6

Now you should be ready to generate the solution, so press the Generate button.

cmake-7

 

Compiling

Open Windows Explorer and go to the build folder inside the one where you unzipped Wt. You should see a solution named WT. Double click it to open it.

windows-explorer-wt-solution

You will see many projects in your Solution Explorer. We will start by compiling only the key ones to make problem solving easier (in case problems arise). So right click on wt and select build.

visual-studio-build

You will see some warnings during compiling. That’s correct. But at the end you should see the famous Build: 1 succeeded message, 0 failed.

visual-studio-build-2

Now do the same to the wthttp project and finally to the hello project.

If compilation went fine (of course it went fine!, why it would not?) we are ready for the next phase: testing.

 

Testing

Right click on the hello project and select Set as StartUp Project.

visual-studio-set-as-default

Right click again on it and select Properties. Add the following string to the Command Arguments under Debugging:

--http-address=0.0.0.0 --http-port=8080 --deploy-path=/hello --docroot=.

 

visual-studio-project-properties

Click Run. Your application should run showing a screen like the following:

wt-running

Open your Internet browser and go to http://localhost:8080/hello.

wt-witty-running

Voila!

 

Installing (optional)

In Visual C++ go to the Solution Explorer and look for a project named INSTALL. Right click on it and choose Build. When the process finishes, go to C:Program FilesWt. You will find the Wt include and lib folders there.

 

15 Replies to “How to install Wt (Witty) on Windows”

  1. Hi Andres,

    I really appreciate the layout of this tutorial. It really helped me get a long to installing the latest Wt (Witty) version 3.2.3 on Windows 8 with Visual Studio 2012.

    I was hoping you could help me out with something, even though this tutorial applies to VS2008. I’m up to the point where I generated the Visual Studio solution file and about to compile the wt Project within the WT solution, but when I try to build it, it fails with numerous fatal error C1189s (The C++ Standard Library forbids macroizing keywords) being applied to the “inline” keyword that Wt is apparently “macroizing” in multiple locations according to the error.

    Do you happen to know anything about this?

    1. I’m having the same problem.
      Once in VIsual studio (I use VS 9 2008), I try to build any project (wt, home, hello…) and it fails with many errors.

      1>….srcwebCgiParser.C(212) : warning C4244: ‘initializing’ : conversion from ‘int64_t’ to ‘unsigned int’, possible loss of data
      1>….srcwebCgiParser.C(214) : warning C4244: ‘argument’ : conversion from ‘int64_t’ to ‘std::streamsize’, possible loss of data
      1>….srcwebCgiParser.C(246) : error C2589: ‘(‘ : illegal token on right side of ‘::’
      1>….srcwebCgiParser.C(246) : error C2059: syntax error : ‘::’
      1>….srcwebCgiParser.C(247) : warning C4244: ‘argument’ : conversion from ‘int64_t’ to ‘std::streamsize’, possible loss of data
      1>….srcwebCgiParser.C(309) : error C2589: ‘(‘ : illegal token on right side of ‘::’
      1>….srcwebCgiParser.C(309) : error C2059: syntax error : ‘::’
      1>….srcwebCgiParser.C(323) : error C2589: ‘(‘ : illegal token on right side of ‘::’
      1>….srcwebCgiParser.C(323) : error C2059: syntax error : ‘::’
      1>….srcwebCgiParser.C(323) : error C2143: syntax error : missing ‘(‘ before ‘::’
      1>….srcWtAuthPasswordStrengthValidator.C(33) : warning C4003: not enough actual parameters for macro ‘max’
      1>….srcWtAuthPasswordStrengthValidator.C(33) : error C2589: ‘(‘ : illegal token on right side of ‘::’
      1>….srcWtAuthPasswordStrengthValidator.C(33) : error C2059: syntax error : ‘::’
      1>….srcWtAuthPasswordStrengthValidator.C(33) : error C2059: syntax error : ‘)’
      1>….srcWtAuthPasswordStrengthValidator.C(33) : error C2059: syntax error : ‘)’
      1>….srcWtHttpRequest.C(187) : warning C4244: ‘return’ : conversion from ‘int64_t’ to ‘int’, possible loss of data
      1>….srcWtHttpRequest.C(274) : warning C4003: not enough actual parameters for macro ‘max’
      1>….srcWtHttpRequest.C(274) : error C2589: ‘(‘ : illegal token on right side of ‘::’
      1>….srcWtHttpRequest.C(274) : error C2059: syntax error : ‘::’
      1>….srcWtChartWAxis.C(88) : error C2589: ‘(‘ : illegal token on right side of ‘::’
      1>….srcWtChartWAxis.C(88) : error C2059: syntax error : ‘::’
      1>….srcWtChartWAxis.C(89) : error C2589: ‘(‘ : illegal token on right side of ‘::’
      1>….srcWtChartWAxis.C(89) : error C2059: syntax error : ‘::’
      1>….srcWtChartWAxis.C(178) : error C2589: ‘(‘ : illegal token on right side of ‘::’
      1>….srcWtChartWAxis.C(178) : error C2059: syntax error : ‘::’
      1>….srcWtChartWAxis.C(197) : error C2589: ‘(‘ : illegal token on right side of ‘::’
      1>….srcWtChartWAxis.C(197) : error C2059: syntax error : ‘::’
      1>C:Program FilesMicrosoft SDKsWindowsv6.0Aincludewinsock2.h(264) : error C2011: ‘protoent’ : ‘struct’ type redefinition
      1> C:Program FilesMicrosoft
      1>….srcwebSocketNotifier.C(169) : fatal error C1003: error count exceeds 100; stopping compilation
      1>Build log was saved at “file://c:Program Files (x86)Wtwt-3.2.3binariessrcwt.dirDebugBuildLog.htm”
      1>wt – 172 error(s), 28 warning(s)
      ========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========

  2. I was about to give up trying to get wt installed on windows – As a final attempt I followed your install instructions of boost (not using boostpro which is no longer supported) and then skipped the boostpro references in this article and it worked a treat. Many thanks!

    1. Hi Sam,

      Yes, you can. The rule is to avoid any operating system call. If you have to, enclose them in define endif tags.

  3. Hi, have you ever tried building Wt with the Intel compiler in MSVC? I built GraphicsMagick and boost with Intel, and then when building Wt, the compiler finds code errors and build fails. Looking for some advice, since it is hard to ignore the 30-50% performance improvement I get with my application code with Intel.

    Also a note on your install instructions above, using VS2010 you have to do a >project only< build, not just build on the INSTALL project. The usual F7 build just builds the current startup project, which is not INSTALL.

    1. Hi Tom,

      I’m sorry but I don’t have experience with the intel compiler. But you are right, those numbers are hard to ignore!

      Thanks for the comment on VS2010… I will check the article.

  4. Hi,

    I keep on getting:

    TRACKER : error TRK0002: Failed to execute command: “”C:Program Files (x86)Microsoft Visual Studio 10.0VCbinCL.exe”

    when I try to build wt

    may i know what’s going on / how to fix?

    thank you!

  5. Hi Andres,

    Very helpful tutorial! However, I’m using MS VS 2013 and there is no option for doing this

    “change the Microsoft Visual C++ options (Tools menu > Options > Project and Solutions > VC++ Directories) to ensure that

    $(SystemRoot)
    $(SystemRoot)System32
    $(SystemRoot)System32wbem
    are specified BEFORE $(PATH)”

  6. Hi Andres,
    I was trying to install Wt following the instruction above, but when I specify the generator and press finish, an error window pops-up which says “Error in configuration process, project files maybe invalid” . Do u have any idea why this error keeps coming ?
    Thanks in advance :))

  7. My C:/Wt-3.3.6-msvs2015-Windows-x64-SDK/build/ directory has the CMakeLists.txt file, but for some reason CMake GUI can’t find it there. What do I do? It keeps telling me that project files may be invalid and that my chosen directory “doesn’t appear to contain CMakeLists.txt”.

Leave a Reply