Building Teigha with GCC on Windows

Irina Bezruk

May 30, 2017

ODA Founding and Corporate level subscribers can build Teigha from source code. Starting with Teigha version 4.3.0, these subscribers can build Teigha from source with GCC 5.x compiler on Microsoft® Windows®.

To achieve this goal, you need to have MinGW installed on your computer ( After MinGW installation, add a bin folder to the PATH environment variable in order to find g++/gcc compilers and the mingw32-make build tool.

When the bin folder is in the PATH, you can check cmd; the g++ compiler can be found by printing:

C:\>g++ --version
g++ (GCC) 5.3.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO

Please pay attention that the ODA builds Teigha with GCC 5.3 version. If you have an older GCC compiler or a newer one, it’s possible you’ll receive many compiler errors.

When the build environment is configured, open the folder with Teigha source files and open the command prompt. Use the ODAProjectFileGenerator.exe script to generate project files and select one from two proposed configurations (static or dynamic based on your needs):
•    Desktop Windows GCC 5.3 32-bit static
•    Desktop Windows GCC 5.3 32-bit dll
Then follow the standard steps for project generation: select appropriate targets/build type/folder name. 

ODAProjectFileGenerator.exe will open the generated projects in the command prompt window. To start a build, just type to build the code with 8 jobs (running simultaneously):

C:\ >mingw32-make -j8

Some important notes:
•    New configurations (GCC on Windows) will create Windows libraries.
•    The following definitions are used to build:
      •    ODA_WINDOWS,
      •    ODA_WINDOWS_GCC