Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Analog: Help

Compiling Analog for Windows - updated instructions

 

 

Analog help RSS feed   Index | Next | Previous | View Threaded


Analog07 at eircom

May 5, 2009, 11:44 AM

Post #1 of 2 (1162 views)
Permalink
Compiling Analog for Windows - updated instructions

Analog can be compiled for Windows using MinGW, a gnu environment for Windows.

The current version of MinGW is a little bit easier to install than the previous version. No mor "tarballs". MSys still has to be installed seperately, and could do with a belt of the clue stick, but you can basically install both, using the default settings, in about 3 minutes.

Download a copy of the current version of MinGW from
http://sourceforge.net/project/downloading.php?group_id=2435&filename=MinGW-5.1.4.exe

You can just accept the defaults -
Select "Download and install", click Next.
Click "I agree".
Select Current, click Next.
Select Minimal, and just the "MinGW base tools" and click Next.
C:\MinGW and click Next, MinGW and click Install.


Download the MSys package:
http://sourceforge.net/project/downloading.php?group_id=2435&filename=MSYS-1.0.10.exe&a=61247139

Run MSYS-1.0.10.exe and follow the prompts:

This will install "Minimal SYStem". Do you wish to continue? (Yes)
Welcome to the "Minimal SYStem" Setup Wizard .... (Next)
License Agreement (Yes)
Release Notes (Next)
Select Destination Directory (C:\msys\1.0) (Next)
Installation for i386 based CPUs (Next)
Select MenuStart Folder (MinGW) (Next)
Ready to Install (Install)

A DOS window will open and ask you some questions:
This is a post install process that will try to normalize between
your MinGW install if any as well as your previous MSYS installs
if any. I don't have any traps as aborts will not hurt anything.
Do you wish to continue with the post install? [yn ]
y [enter]
Do you have MinGW installed? [yn ] y
y [enter]
Please answer the following in the form of c:/foo/bar.
Where is your MinGW installation?
C:/MinGW [enter]
.....
Oh joy, you do not have C:/MinGW/bin/make.exe. Keep it that way.

C:\msys\1.0\postinstall>pause
Press any key to continue . . .
[enter], then click Finish.

Now grab a copy of Analog with the source from http://analog.cx/anlg60.zip

and unzip it to c:\analog-6.0.

To edit the Analog source, you will need a simple text editor that can handle unix style line ends. Notepad won't do. If you know how to use vi, MSys includes a copy. If you'd prefer to stick with Windows tools, try Notepad++ (http://notepad-plus.sourceforge.net/) or Editpad Lite (http://www.editpadpro.com/editpadlite.html) or the like.

First you need to edit C:\analog-6.0\src\Makefile
Line 32:
Change OS = UNIX
to OS = WIN32

Line 34:
Change LIBS = -lm
to LIBS = -lwsock32 -lm

Now you can make your changes to whichever source files need to be modified.

Once you've made your changes to the source code, run MSYS (there should be an icon on your desktop, or select it from Start/Run/MinGW/MSys.

A window will open with a $ prompt. Type cd /analog-6.0/src to navigate to your modified source, and type make

If there aren't any errors in your code, then a few minutes later you should have a new copy of analog.exe with your modifications. Note that it won't have the Analog icon, but other than that it should work fine.

Aengus

+------------------------------------------------------------------------
| TO UNSUBSCRIBE from this list:
| http://lists.meer.net/mailman/listinfo/analog-help
|
| Analog Documentation: http://analog.cx/docs/Readme.html
| List archives: http://www.analog.cx/docs/mailing.html#listarchives
| Usenet version: news://news.gmane.org/gmane.comp.web.analog.general
+------------------------------------------------------------------------


Analog07 at eircom

May 5, 2009, 12:22 PM

Post #2 of 2 (1082 views)
Permalink
Re: Compiling Analog for Windows - updated instructions [In reply to]

Aengus <Analog07 [at] eircom> wrote:
> If there aren't any errors in your code, then a few minutes later you
> should have a new copy of analog.exe with your modifications. Note
> that it won't have the Analog icon, but other than that it should
> work fine.

It turns out that adding the icon isn't very difficult. You need to create a resource file, generate an object file from it, and then include that object file when compiling the executable.


1) Create a file called resource.rc in the src directory with just one line in it

ID ICON "../docs/favicon.ico"

2) Generate the object fil by running this command in MSys:
windres resource.rc -O coff -o resource.o

3) modify the Makefile by adding resource.o to the OBJS list on line 53 through 56.

This information came from:
http://blog.stranadurakov.com/2009/04/27/icon-and-version-information-resource-file/

Aengus

+------------------------------------------------------------------------
| TO UNSUBSCRIBE from this list:
| http://lists.meer.net/mailman/listinfo/analog-help
|
| Analog Documentation: http://analog.cx/docs/Readme.html
| List archives: http://www.analog.cx/docs/mailing.html#listarchives
| Usenet version: news://news.gmane.org/gmane.comp.web.analog.general
+------------------------------------------------------------------------

Analog help RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.