Skip to content
tin-pot edited this page Dec 29, 2011 · 13 revisions

-- UNIX and OSX users --
Unzip or checkout a version of LibreCAD into a directory.
CD into that directory and follow these instructions:

Build makefile and compile LibreCAD

qmake
make

NOTE: On Fedora and perhaps other systems (Ubuntu?) You
need to run “qmake-qt4” instead of just “qmake”.

-- Windows Users --

Download a copy of QT SDk from http://qt.nokia.com/downloads/

After installation, start qtCreator and load LibreCAD.pro,
from the the build menu select ‘Build All’

-- Users of MS Visual Studio and/or Qt 4.3/4.4 --

(tin-pot 2011-12-29)
While LibreCAD “officially” needs Qt 4.5 and QtCreator/gcc to build,
it can be tweaked to be build with

  1. Visual Studio (as early as .NET 2003) and
  2. Qt 4.3 or 4.4 (I’m currently using 4.3.1)

A repository containing the necessary changes is at github

Summary of modifications:

  • Emulate some C99 functions: LibreCAD uses remainder()
    and friends form <math.h>, which MSVC does not have and possibly never will. Two files
    emu_c99.h
    emu_c99.cpp

    are added to provide replacements using inline assembler code for the x87 FPU, and
    a macro EMU_C99 is defined in the customization Qt project file
    custom.pro
    to include these where needed.
  • Work around missing Qt 4.4 and 4.5 features: LibreCAD uses some
    stuff of Qt which was first introduced in versions 4.4 rsp 4.5. Most of this
    is benign and can trivially be emulated, eg QList<T>::removeOne(..);
    some can (hopefully) be simply omitted, eg QMdiArea::setViewMode(..).
  • Use Qt 4.3 help system: Version 4.4 of Qt introduced a comprehensive
    help system (QHelpEngine and others) and deprecated QAssistantClient.
    Code ressurected from older LibreCAD/QCad versions which is planted into
    qc_applicatonwindow.cpp allows to use this older help technique.

All changes can be found by searching for the symbols

EMU_C99
QT_VERSION 0x040400
QT_VERSION 0x040500
_MSC_VER

The code was cloned from the current LibreCAD git (around 2011-12-29T14:40+0100)
and I’ll try to keep it up to date.

Of course, all modifications should automatically be ignored by means of preprocessor
magic when building without
EMU_C99 rsp with Qt 4.5 – but this needs testing …

Clone this wiki locally