Skip to content

Installation under windows 32 bit

Yihui Xie edited this page Jan 19, 2015 · 11 revisions

Please see http://cranvas.org/download.html instead.

Build qtbase

  1. Install R and Rtools. Add the following to your PATH, in which ... should be substituted by the directory that installed R and Rtools.
...\Rtools\bin;
...\Rtools\gcc-4.6.3\bin;
...\R\bin\i386;
  1. Install cmake 2.8.11 from http://www.cmake.org/files/v2.8/cmake-2.8.11-win32-x86.exe. Add ...\CMake 2.8\bin to the PATH.

  2. Download and install the Qt libraries (32 bit Windows). Then add ...\Qt\4.8.4\bin to the PATH.

  3. Install Perl and add its bin to the PATH.

  4. Set the CMAKE environment variable to point to your cmake.exe. (for example, ...\CMake 2.8\bin\cmake.exe)

  5. Set QMAKE environment variable to point to qmake.exe. (for example, ...\Qt\4.8.4\bin\qmake.exe)

  6. Set RC_COMPILER environment variable to point to windres.exe from Rtools. Make sure to change the backslash(\) to slash(/) here. (for example, .../Rtools/gcc-4.6.3/bin/windres.exe)

  7. Set QTBASE_QT_PATH to the directory containing qmake.exe. (for example, ...\Qt\4.8.4\bin)

  8. Make sure perl, cmake, Qt, R-32bit, Rtools, Rtools-gcc are on your PATH. Example PATH to build qtbase (better to put these before others):

C:\Program Files\Rtools\bin;
C:\Program Files\Rtools\gcc-4.6.3\bin;
C:\Program Files\R\bin\i386;
C:\Qt\4.8.4\bin;
C:\Perl\bin\;
C:\Program Files\CMake 2.8\bin;
[... other directories ...]
  1. Download qtbase and unzip it. It does not matter where you unzip it. Change the folder name from "qtbase-master" to "qtbase".

  2. (This should be fixed in code) Check .../qtbase/src/mkdef.sh. Change sed -n $1 tmp >> qtbase.def to sed -n 's/^.* [BCDRT] _/ /p' tmp >> qtbase.def

  3. Make a copy of the whole qtbase folder. Put it in another directory, or just rename it. Don't delete this clean copy until you successfully install qtbase after step 13.

  4. Start the command shell, go to the directory containing qtbase. Run:

R CMD INSTALL --build qtbase
Please make sure the folder qtbase is completely clean (i.e., not pre-installed).

Build qtpaint

  1. Add the ...\qtbase\local\lib to PATH. where ... is replaced by your R library path. Run ?.libPaths in R to find out it.

  2. Download glext.h from http://www.opengl.org/registry/api/glext.h And copy it to ...\Qt\4.8.4\src\opengl\

    Add a line to ...\Qt\4.8.4\include\QtOpenGL\qgl.h :

#include "../../src/opengl/glext.h"
??? An alternative way is editing `OpenGLPainter.cpp`
	#ifdef Q_OS_WIN
	#include "glext.h"
	#endif
  1. Download qtpaint Start the command shell, go to the directory containing qtpaint. Run:
	R CMD INSTALL --build qtpaint