Sunday, March 26, 2006

wxtide32 build with mingw

Noticed that wxtide32 a windows port of xtide includes source code. The author uses lcc to compile but I wanted to try mingw. During the process I learned a bit about windows programming, resource files, and resource file editors.

Tools that I used:
01. firefox for research
02. MinGW and MSYS
03. vim6
04. olly debugger
05. diff and patch
06. xnresourceeditor
07. Gorcjorg.zip resource compiler

The source files are included with the wxtide distribution and compressed with 7-zip after unzipping, I started trying to compile each .c file. For the most part there were no problems and the error messages from MinGW were helpful.

I spent a quite some time trying to figure out a problem compiling WXTide32.RC with windres.exe which gave parse errors at various lines. My first approach was to comment out the offending lines which worked. Then I tried the GoRC.exe resource compiler which had no problems with the source. At the time I didnt know anything about resource files and after some research on the web had no more insight about how to debug the problem with windres.exe. I tried a couple of resource tools, resource hacker and resource editor but they seemed to have no problems with the source. Eventually I realized that the header file had some definition mismatches with the .rc file and corrected it in the resource file and two of the .c files.

I made several mistakes while editing the Makefile and getting the link to work. After the application was linked, it died at runtime. I ran it through the olly debugger and there was a message about tide2idx so removed it from the object linking. After that the application ran with the addition of some input files. Later I realized that there was some documentation about how to compile the application but was not aware of it during my initial efforts.

The process was educational and I would recommend it to anyone who is interested in c programming using free compilers. The failure of windres.exe to compile WXTide32.rc was valid and I decided to use diff and patch to make the necessary changes to the original source code so that it would compile with MinGW. Although the author uses lcc which is free for non commercial use, getting wxtide32 to compile using MinGW was a good idea after all.

0 Comments:

Post a Comment

<< Home