Personal tools
You are here: Home cmgui Wiki Building cmgui on win32
Views
FrontPage >>

Building cmgui on win32

last edited 1 year ago by rchristie

The most popular offerings of the GNU toolchain (compilers, linkers, runtimes) under windows are cygwin and mingw. We commonly build cmgui for windows within the cygwin environment so we can use all the unix utilities we know and love. However, we never build cygwin binaries which would would have an undesirable dependency on the cygwin1.dll, cygwin's emulation layer over windows. Instead we build MinGW binaries which work directly with windows runtime libraries, i.e. msvcrt. To achieve this, we note that MinGW is installed with cygwin and mingw binaries are built by passing the -mno-cygwin (''no cygwin'') switch to the GNU compilers and linker: the cmgui makefiles do this automatically under cygwin. This means that all additional libraries like wxwidgets, mesa etc. need to be built for mingw; if you do not consistently build for MinGW, you will receive a large number of linker errors at the end of compilation!

The following description was written towards the end of 2005 and is kept for posterity. You are probably better off looking at the more up to date Peter's notes on building cmgui

Step 0: Install Cygwin

Cygwin is a Linux-like environment for Windows. Once installed you can start up a shell and use all the usual linux commands (assuming you opted to install the relevant packages). It is recommended you install Cygwin if you wish to build cmgui on a windows machine as it makes the process much simpler. For instructions see Installing Cygwin.

Step 1: Build perl

You need MSYS(which requires MinGW). Get MSYS and MinGW at http://www.mingw.org/download.shtml#hdr3. You need a working system perl(not specific to cmgui), which could come from Cygwin. (Note MinGW can be installed with Cygwin).

Start a shell using the icon created by the MSYS installer, change to the directory in which you want to create the perl build subdirectory. Check out the perl cvs module from CMISS CVS, and change into the perl/build subdirectory. Run "unset SHELL" and "export SYSNAME=win32". Also be sure to set CMISS_ROOT to the directory into which you are checking out everything into. Then run "perl Makefile.pl". This will produce the perl binary required in $(CMISS_ROOT)/perl/lib/CORE/libperl.a

Step 2: Build perl_interpreter

After building perl, run MinGW as above, and set the environment variables as above. Checkout the perl_interpreter, and go into the perl_interpreter directory, and type make OPT=1 INCLUDE_PERL=1.

Step 3: Build cmgui

checkout image_libraries, linear_solvers, cm, and cmgui into the same directory(the same as the one you checked out the perl_interpreter into). From the cygwin(not MSYS) shell, go into the directory where you checked everything out, and type:
export CMISS_ROOT=`pwd`
export SYSNAME=win32
cd image_libraries
make
cd ..
cd linear_solvers
make
cd ..
cd cmgui
make -f cmgui.make cmgui-static-lib

Contributing to this site

Please add to the wiki any relevant information that you think might be useful to other users of this website. For example, you might like to contribute your experiences, questions and answers.

You are encouraged to contribute to this site regardless of your level of experience. Contributions are welcomed from new and regular visitors.

If you ask a question and receive an answer from a developer you should record it in the wiki. This information is extremely useful and can help other users overcome the same problem.

See how to add and edit pages for more information.