Compiling Code Using Cygwin - Lessons I've Learned

General support questions and announcements for MS3. See also MS3 manuals.

Moderators: jsmcortina, muythaibxr

Post Reply
stirlsilver
Helpful MS/Extra'er
Posts: 38
Joined: Sat Jun 29, 2013 5:29 am

Compiling Code Using Cygwin - Lessons I've Learned

Post by stirlsilver »

Hi All,
After trying for a couple of days to get my custom code to compile, I finally had some success and I figured I should point out a few of the lessons learned in the process because I found it difficult to find the information in previous threads on this forum. The entries below are in order of execution.

1. Download Cygwin - Do not download the 64 bit version of Cygwin, I was getting an [xgate.o] error 127 which only went away when I deleted Cygwin and installed the 32bit version. This is despite using a computer with windows 10 64bit.
2. Installing Cygwin - When installing Cygwin, you don't need to install the entire "Devel" library which is very large and takes a long time to download. I was able to compile by simply selecting under the "Devel" library all the entries starting with "GCC" and "Make".
3. Download & unpack the Build tools - When running the "tar xfz <path>/tools.tar.gz" command in Cygwin to unpack the file which was downloaded from http://www.msextra.com/tools, make sure to go "cd c:/" first. When you run the tar command, the contents will be placed in C:\usr. If the usr folder ends up somewhere else, you will get an error later when you try to compile. If you get an error when running the tar command that says "cannot connect to c: resolve failed" try replacing c: with /cygdrive/c/ so as an example "tar xfz c:/tools.tar.gz" would be "tar xfz /cygdrive/c/tools.tar.gz"
5. Compiling the code - use the cd command to get to the folder where the source code files are (I copied the ms3 folder to C:\ so I went "cd c:\ms3"). Then simply run "make" to execute the compilation process

Hopefully the above will help someone. I got caught out by both installing the 64bit version of Cygwin and unpacking the build tools into the wrong folder which gave me all sorts of grief when trying to figure out what was going on.

Stirling
rabid
Experienced MS/Extra'er
Posts: 303
Joined: Mon May 09, 2005 7:44 am

Re: Compiling Code Using Cygwin - Lessons I've Learned

Post by rabid »

I am bringing this back to add knowledge and remind myself what I did in 4 years from now.

You must use the 32 bit version of cygwin to use the tools. I had no luck on my windows 10 computer. I think it might be security related. If anyone has gotten this working on windows 10, chime in. It's been 4 years since I last installed and used these tools. It used to work on my windows 7 computer. I think that was a 64 bit processor though. So today I installed it on an older windows 7 32 bit laptop and had no problem. I only installed cygwin 32 bit with "make" (the GNU version found under devel in packages). Nothing else was required. Then I copied the tools.tar.gz from the 2012 windows zip file to c:. Then ran cygwin, cd c: and tar xfz tools.tar.gz That puts a usr directory in c: because that's where you extracted it from. When you run make in the same directory as your source files, it looks for the tools in c:/usr/bin. If all goes well, you end with a .s19 file.
joshbober
MS/Extra Newbie
Posts: 4
Joined: Mon Nov 05, 2018 9:52 am

Re: Compiling Code Using Cygwin - Lessons I've Learned

Post by joshbober »

Chiming in here to say that I have had success (just now) with this on my up-to-date Windows 10 PC. I followed the instructions that rabid provided.

A couple of small things I want to clarify for anyone else who tries this and didn't know better (like myself):
- When installing Cygwin, there are some options pre-selected. You do not need to deselect these, just also select "make" under Devel.
- For the command "tar xfz tools.tar.gz" to work, you would need the "tools.tar.gz" file in the C: directory, otherwise you need to specify the path to the file. For example: "tar xfz c:\Users\yourUserDir\Downloads\tools.tar.gz"
- If your MS3 code project is Git-tracked, there may be some memory conflicts while trying to compile your project. Restarting my computer fixed this for me.
Post Reply