Open2300 - Compiling With Min GW
You are here: Foswiki>Open2300 Web>CompilingWithMinGW (21 Aug 2009, RaphaelD)Edit Attach

Compiling Open2300 with MinGW on Windows

This topic described the exact steps that you need to take to compile Open2300 on Windows. You will be guided step by step through installing a version of MinGW that is known to give working Open2300 binaries. And the best of it all. It is all free open source tools.

Downloading MinGW

The download page at MinGW is a mess! It is the worst example of poor configuration management and total lack of understanding of what a new user needs to get started. The documentation is not up to date. The wiki is not up to date. And the words are too many describing too little. OK. KennethLavrsen got his message transmitted.

You need only TWO files downloaded to get MinGW and a minimal Posix system installed. What this gives is a minimalistic unix type environment and a C compiler called MinGW. Do not worry about how things work and why they work. KennethLavrsen hardly knows. Follow the guide to the exact word and you will have working open2300 binaries in a few minutes.

The two files you need are: msys-XXX.exe and MinGW-XXX.exe where the XXX is the version number. The recommendation is to install the current release files. But when this guide was written there was no MinGW-XXX.exe in the current release. But there is one in the previous release??? A bloody mess. The following combination is known to work with open2300. The files gets downloaded from the MinGW Sourceforge project.

Installing MinGW

  • First you install MinGW-3.1.0-1.exe. Simply doubleclick on it after download.
  • It is a good idea to avoid installing in directories with spaces. I suggest using the default C:\MinGW

  • Second install MSYS-1.0.10.exe. Again simply doubleclick on it.
  • I suggest installing it in the default C:\msys\1.0
  • During installation a "DOS window" appears and asks questions".
  • It asks: "Do you wish to continue with the post install [yn]?" - Answer "y"
  • It then asks: "Do you have MinGW installed?" - Answer "y"
  • It then asks: "Where is your MinGW installation?" If you followed the advice earlier the answer is: c:/MinGW/. Note that the path names are case sensitive
  • It then says: "Oh joy, you do not have c:/MinGW/bin/make.exe. Keep it that way". This means that it is happy. This is not an error. Hit any key to continue.
  • Finish and you are done. You have installed MinGW and MSYS

Crash course in msys and UNIX

  • In your start menu under "Programs" you now have an entry called MinGW and below that MSYS and again below that a program called msys.
  • Try starting msys.
  • You end up in a terminal with a command prompt. What you need now is a crash cource in UNIX. You need the few basic commands to get by.

Command in msys/UNIX equivalent in DOS Description
cd cd Change directory. Note that instead of \ you use /
cp copy copy file
rm del delete/remove file
mkdir mkdir make directory
rm -R rmdir remove directory
ls dir list files in directory
ls -al - list files in directory including hidden files and with extended display
make - Run compiler as directed in the file called Makefile
make clean - Delete all the compiled files

  • Now you know the UNIX you need.
  • Outside the msys environment your default directory inside msys is actually c:\msys\1.0\home\USERNAME\
  • USERNAME is the username that you are logged in as under windows.

Getting ready to compile

  • In msys create a directory called open2300: mkdir open2300
  • Change directory to open2300: cd open2300
  • In a file manager under Windows (ie outside msys) now copy all the files from the open2300 package to c:\msys\1.0\home\USERNAME\open2300
  • In the file manager rename Makefile to Makefile-linux (or delete it) and then rename Makefile-windows to Makefile.
  • In msys list the directory to check that you can now see the files.

Compile

  • In msys run make: make
  • All the open2300 programs except the mysql programs that are not made for Windows are now built.
  • In your file manager outside msys - you can now see a lot of files including new .exe files.
  • Simply copy these exe files to where you want them.
  • You can now leave msys

  • smile That is it. It is that easy smile

Re-compile

If you later download a newer version of open2300 you can reuse the build directory. Or you can modify the source files and make your own improvements.

It is recommended to recompile everything when you change the sources. Especially if you edit rw2300.c and any .h files.

  • In msys run: make clean
  • Followed by: del *.exe
Then you have a clean source file directory and can run make again.

Checking out from SVN directly to the msys directory using TortoiseSVN

In the following it is assumed that you have installed TortoiseSVN

  • In the file manager in windows navigate to c:\msys\1.0\USERNAME\open2300 - replace USERNAME with your Windows login
  • Right click so you get a menu and select TortoiseSVN > Checkout
  • In the menu you get...
    • URL of repository: http://www.lavrsen.dk/svn/open2300/trunk
    • Checkout directory: C:\msys\1.0\home\USERNAME\open2300 - again replace USERNAME with your Windows login
    • Leave rest as default, only HEAD revision checked
  • All you need now is to enter msys, change directory to open2300 and run make.

GUI? DLL?

  • GUI - No idea. Never programmed a single GUI program in Windows
  • DLL - It is possible - but I never tried. Feel free to create a new TWiki topic WindowsDllOpen2300 and describe how if you know
-- KennethLavrsen - 01 Aug 2006
Topic revision: r2 - 21 Aug 2009, RaphaelD
Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
This website only use harmless session cookies. See Cookie Policy for details. By using this website you accept the use of these cookies.