Angband.oook.cz
Angband.oook.cz
AboutDownloadVariantsLadderForumCompetitionSpoilersComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old September 15, 2011, 13:02   #1
Magnate
Angband Devteam member
 
Join Date: May 2007
Location: London, UK
Posts: 4,981
Magnate is on a distinguished road
Send a message via MSN to Magnate Send a message via Yahoo to Magnate Send a message via Skype™ to Magnate
Does anyone use cygwin?

I'm trying to get my head around developing on Windows. I've installed cygwin, which allows me (if I patch src/Makefile to pick up /usr/include/ncurses properly) to build ... the unix versions (gcu, x11, potentially SDL and GTK). It seems perverse to install cygwin and then cross-compile the Windows version ... does anyone actually do this? If so, why?
__________________
"3.4 is much better than 3.1, 3.2 or 3.3. It still is easier than 3.0.9, but it is more convenient to play without being ridiculously easy, so it is my new favorite of the versions." - Timo Pietila
Magnate is offline   Reply With Quote
Old September 15, 2011, 13:46   #2
Timo Pietilš
Prophet
 
Join Date: Apr 2007
Location: Half way to grave
Posts: 3,247
Timo Pietilš is on a distinguished road
Quote:
Originally Posted by Magnate View Post
I'm trying to get my head around developing on Windows. I've installed cygwin, which allows me (if I patch src/Makefile to pick up /usr/include/ncurses properly) to build ... the unix versions (gcu, x11, potentially SDL and GTK). It seems perverse to install cygwin and then cross-compile the Windows version ... does anyone actually do this? If so, why?
I use cygwin. Reason is that it just is so simple with it. Just command make -f makefile.thisandthat (can't remember which one) to make perfectly working windows compile. All those windows-development programs are either pain in the butt to set up properly (its like no-one making these systems actually knows how Windows works), or they are not freeware.
Timo Pietilš is offline   Reply With Quote
Old September 15, 2011, 13:55   #3
nppangband
NPPAngband Maintainer
 
Join Date: Dec 2008
Location: Stat Gain, Angband
Posts: 807
nppangband is on a distinguished road
I use cygwin to compile the windows build for NPP and Angband (but the current Angband won't compile with cygwin).

As for the why, I have heard that mingw is better but I couldn't get it installed properly, and I thought the instructions and documentation was garbage. I installed cygwin and had it working with eclipse as my editor in about 5 minutes, so I just stuck with it. (Note: I have no experience programming outside of the Angband source code, and I only know enough c programming to make the changes I want to.)

Before that, I used LCC-WIN to compile. Also, I have to use the windows interface for github because I can't figure out how to get it to work from a prompt. (and I can hear you all laughing at me, stop it! )
nppangband is offline   Reply With Quote
Old September 15, 2011, 14:01   #4
Magnate
Angband Devteam member
 
Join Date: May 2007
Location: London, UK
Posts: 4,981
Magnate is on a distinguished road
Send a message via MSN to Magnate Send a message via Yahoo to Magnate Send a message via Skype™ to Magnate
Thanks both for the replies. I think it's worth adding a cygwin section to the compiling.txt doc that d_m has added to the repo. Especially if building the Windows binary is as easy as Timo says (I haven't got that far yet - I can play in gcu mode).

@Jeff: I would point you at the git user manual, but it's hosted at kernel.org which is down at the moment (massive hacking scandal). tbh the only commands I ever use are

git checkout
git fetch
git merge
git rebase
git push
git log
git diff
git status
git commit
git reset

There are loads of others, but those cover about 99% of usage (plus git clone, git branch and git remote to set things up).
__________________
"3.4 is much better than 3.1, 3.2 or 3.3. It still is easier than 3.0.9, but it is more convenient to play without being ridiculously easy, so it is my new favorite of the versions." - Timo Pietila

Last edited by Magnate; September 15, 2011 at 15:56.
Magnate is offline   Reply With Quote
Old September 15, 2011, 14:11   #5
Magnate
Angband Devteam member
 
Join Date: May 2007
Location: London, UK
Posts: 4,981
Magnate is on a distinguished road
Send a message via MSN to Magnate Send a message via Yahoo to Magnate Send a message via Skype™ to Magnate
Quote:
Originally Posted by Timo Pietilš View Post
I use cygwin. Reason is that it just is so simple with it. Just command make -f makefile.thisandthat (can't remember which one) to make perfectly working windows compile. All those windows-development programs are either pain in the butt to set up properly (its like no-one making these systems actually knows how Windows works), or they are not freeware.
Hmmm. Can you help me get this working? At the moment I can build the gcu and x11 ports but not SDL or Windows (I haven't tried GTK).

To build Windows, I've tried two things:
Code:
$ make -f Makefile.win
gcc -DWINDOWS -static -Iwin/include -Lwin/lib -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -std=c99 -Wdeclaration-after-statement -O2 -I. -mno-cygwin -c -o attack.o attack.c
gcc: The -mno-cygwin flag has been removed; use a mingw-targeted cross-compiler.

make: *** [attack.o] Error 1
So then I tried using the cross-compile:
Code:
$ MINGW=yes make -f Makefile.win CROSS=i686-mingw32msvc-
i686-mingw32msvc-gcc -DWINDOWS -static -Iwin/include -Lwin/lib -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -std=c99 -Wdeclaration-after-statement -O2 -I. -DCROSS_COMPILE -D_stdcall= -c -o attack.o attack.c
make: i686-mingw32msvc-gcc: Command not found
make: *** [attack.o] Error 127
But I've installed ALL the mingw packages for cygwin, so I don't understand how it can't cross-compile. Any ideas?

EDIT: Solved! cygwin uses slightly different syntax for mingw, it's:

MINGW=yes make -f Makefile.win CROSS=i686-pc-mingw32-

... but it doesn't work. It builds an angband.exe that's only 1.07MB which, when I double-click it, says "The application failed to initialize properly (0xc0000022). Click on OK to terminate the application."

Ho hum. Back to the drawing board.
__________________
"3.4 is much better than 3.1, 3.2 or 3.3. It still is easier than 3.0.9, but it is more convenient to play without being ridiculously easy, so it is my new favorite of the versions." - Timo Pietila

Last edited by Magnate; September 15, 2011 at 14:22.
Magnate is offline   Reply With Quote
Old September 15, 2011, 16:50   #6
nppangband
NPPAngband Maintainer
 
Join Date: Dec 2008
Location: Stat Gain, Angband
Posts: 807
nppangband is on a distinguished road
A couple months ago the standard makefile.win workedt worked just fine (the last time I did a patch for Vanilla). It was only when I did the Angel-to-Ainu patch that I couldn't compile. So if there have been any changes to the makefile.win in the last couple months, that is what is probably preventing cygwin from compiling.
nppangband is offline   Reply With Quote
Old September 15, 2011, 17:07   #7
Magnate
Angband Devteam member
 
Join Date: May 2007
Location: London, UK
Posts: 4,981
Magnate is on a distinguished road
Send a message via MSN to Magnate Send a message via Yahoo to Magnate Send a message via Skype™ to Magnate
Quote:
Originally Posted by nppangband View Post
A couple months ago the standard makefile.win workedt worked just fine (the last time I did a patch for Vanilla). It was only when I did the Angel-to-Ainu patch that I couldn't compile. So if there have been any changes to the makefile.win in the last couple months, that is what is probably preventing cygwin from compiling.
It compiles fine (a small handful of warnings, but nothing serious) - it just doesn't run. Not sure what's going wrong - I'm a novice on Windows.
__________________
"3.4 is much better than 3.1, 3.2 or 3.3. It still is easier than 3.0.9, but it is more convenient to play without being ridiculously easy, so it is my new favorite of the versions." - Timo Pietila
Magnate is offline   Reply With Quote
Old September 15, 2011, 20:06   #8
Timo Pietilš
Prophet
 
Join Date: Apr 2007
Location: Half way to grave
Posts: 3,247
Timo Pietilš is on a distinguished road
Quote:
Originally Posted by Magnate View Post
It compiles fine (a small handful of warnings, but nothing serious) - it just doesn't run. Not sure what's going wrong - I'm a novice on Windows.
Without mingw? To me it looks like this is a problem:

gcc: The -mno-cygwin flag has been removed;

If I needed to install mingw in cygwin I would not be using cygwin. I would use mingw directly in windows.
Timo Pietilš is offline   Reply With Quote
Old September 15, 2011, 20:08   #9
Magnate
Angband Devteam member
 
Join Date: May 2007
Location: London, UK
Posts: 4,981
Magnate is on a distinguished road
Send a message via MSN to Magnate Send a message via Yahoo to Magnate Send a message via Skype™ to Magnate
Quote:
Originally Posted by Timo Pietilš View Post
Without mingw? To me it looks like this is a problem:

gcc: The -mno-cygwin flag has been removed;

If I needed to install mingw in cygwin I would not be using cygwin. I would use mingw directly in windows.
?? So are you saying that if I *uninstall* mingw from cygwin it should build a native Windows executable simply from "make -f Makefile.win"?

I thought, since cygwin is effectively a unix environment inside Windows, that you'd have to cross-compile using mingw32. It hadn't occurred to me that cygwin could build Windows binaries without it. Doh.
__________________
"3.4 is much better than 3.1, 3.2 or 3.3. It still is easier than 3.0.9, but it is more convenient to play without being ridiculously easy, so it is my new favorite of the versions." - Timo Pietila
Magnate is offline   Reply With Quote
Old September 15, 2011, 20:12   #10
Timo Pietilš
Prophet
 
Join Date: Apr 2007
Location: Half way to grave
Posts: 3,247
Timo Pietilš is on a distinguished road
Quote:
Originally Posted by Magnate View Post
?? So are you saying that if I *uninstall* mingw from cygwin it should build a native Windows executable simply from "make -f Makefile.win"?

I thought, since cygwin is effectively a unix environment inside Windows, that you'd have to cross-compile using mingw32. It hadn't occurred to me that cygwin could build Windows binaries without it. Doh.
Yes, it is that easy. Or it at least used to be that easy. It makes native windows executable using Makefile.win.
Timo Pietilš is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Which main-xxx's and makefiles can I test with Cygwin or MinGW? nppangband Development 2 August 23, 2010 09:43
cygwin 1.7 compile error david3x3x3 Development 0 September 13, 2009 00:03


All times are GMT +1. The time now is 22:00.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.