[S] question about compiling for windows

G

Guest

Guest
Archived from groups: rec.games.roguelike.angband (More info?)

This is likely something Leon and/or Scott can answer:

How do you compile the Sangband source for windows to produce the
released windows sangband.exe (i.e what compiler/tools)?

I can compile the Sangband source using Cygwin (with a little bit
of change to the makefile and main-win.c) and run it (once the
font files are in the right place) from a Cygwin shell without any
problems, but if I try to run it from the Run menu, it complains that it
can't find CYGWIN1.DLL. My guess is that this file provides the main()
(and maybe other things) for the program as there isn't one in main-win.c
or any other file.

The sangband.exe that comes with the release doesn't have this problem.
How do I get the executable I make to not need CYGWIN1.DLL or other
files that Windows (Windows 98 in my case) doesn't have?

Thanks.

Larry
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.angband (More info?)

The beta 15 releases were built with Visual Studio 2003.
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.angband (More info?)

Scott Yost wrote:
> The beta 15 releases were built with Visual Studio 2003.

And, it seems, building them with any FREE tools results in a useless
executable, or at least one hobbled by extra DLL dependencies. *And*
requires editing makefiles and otherwise modifying stuff.

This is counter to the spirit of free software. There should be a
version of the sources + makefile that compiles cleanly with mingw or
lcc-win32 without any hand-hacking needed IMO.

--
http://www.gnu.org/philosophy/right-to-read.html
Palladium? Trusted Computing? DRM? Microsoft? Sauron.
"One ring to rule them all, one ring to find them
One ring to bring them all, and in the darkness bind them."
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.angband (More info?)

On 2005-05-27 05:19:50, Larry Bassel <labbmf@ix.netcom.com> wrote:

> How do I get the executable I make to not need CYGWIN1.DLL or other
> files that Windows (Windows 98 in my case) doesn't have?

If you compile in Cygwin, there's no way to produce an executable that doesn't
require the cygwin1.dll file (as far as I know).

You can just copy it from /usr/bin/cygwin1.dll and distribute it along with the
exe. As long as it's in the current directory, the program should execute.

If you want to produce a standalone exe I'd suggest compiling with LCC:
http://www.cs.virginia.edu/~lcc-win32/

cheers
jm
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.angband (More info?)

In article <p7adnYCalZxaJwvfRVn-3Q@rogers.com>,
Twisted One <twisted0n3@gmail.invalid> wrote:
>Scott Yost wrote:
>> The beta 15 releases were built with Visual Studio 2003.
>
>And, it seems, building them with any FREE tools results in a useless
>executable, or at least one hobbled by extra DLL dependencies. *And*
>requires editing makefiles and otherwise modifying stuff.
>
>This is counter to the spirit of free software. There should be a
>version of the sources + makefile that compiles cleanly with mingw or
>lcc-win32 without any hand-hacking needed IMO.

You've got the source.

You've presumably got the compilers.

Go for it.
--
Julian Lighton jl8e@fragment.com
/* You are not expected to understand this. */
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.angband (More info?)

Julian Lighton wrote:
> You've got the source.
>
> You've presumably got the compilers.

Visual Studio 2003? Not on my budget, I bloody well don't. Yet
apparently it is needed to cleanly build the Windows port. For shame.

--
http://www.gnu.org/philosophy/right-to-read.html
Palladium? Trusted Computing? DRM? Microsoft? Sauron.
"One ring to rule them all, one ring to find them
One ring to bring them all, and in the darkness bind them."
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.angband (More info?)

Twisted One wrote:

> Julian Lighton wrote:
>
>> You've got the source.
>>
>> You've presumably got the compilers.
>
> Visual Studio 2003? Not on my budget, I bloody well don't.

You can download the command-line compiler and tools (but not the IDE)
at no cost:

<http://msdn.microsoft.com/visualc/vctoolkit2003/>

Obviously, it's not free in the GNU sense of the word. But it is free in
the "you don't have to sell a kidney" sense, at least.

sherm--

--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.angband (More info?)

Sherm Pendley wrote:
> Twisted One wrote:
>> Julian Lighton wrote:
>>
>>> You've got the source.
>>>
>>> You've presumably got the compilers.
>>
>> Visual Studio 2003? Not on my budget, I bloody well don't.
>
> You can download the command-line compiler and tools (but not the IDE)
> at no cost:
>
> <http://msdn.microsoft.com/visualc/vctoolkit2003/>
>
> Obviously, it's not free in the GNU sense of the word. But it is free in
> the "you don't have to sell a kidney" sense, at least.

If it's easy to build the variant's Windows binary with this subset
(just not actually do any hacking on it), then I'll accept that as just
barely tolerable, while still holding as an opinion that making it build
cleanly using mingw at the very least would be a good idea.

--
http://www.gnu.org/philosophy/right-to-read.html
Palladium? Trusted Computing? DRM? Microsoft? Sauron.
"One ring to rule them all, one ring to find them
One ring to bring them all, and in the darkness bind them."
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.angband (More info?)

In article <cKednWW4I4rZVgvfRVn-1g@rogers.com>,
Twisted One <twisted0n3@gmail.invalid> wrote:
>Julian Lighton wrote:
>> You've got the source.
>>
>> You've presumably got the compilers.
>
>Visual Studio 2003? Not on my budget, I bloody well don't.

No, the free compilers you want it to build out of the box with.

>Yet
>apparently it is needed to cleanly build the Windows port. For shame.

You can do something about it.
--
Julian Lighton jl8e@fragment.com
/* You are not expected to understand this. */
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.angband (More info?)

Julian Lighton wrote:
> In article <cKednWW4I4rZVgvfRVn-1g@rogers.com>,
> Twisted One <twisted0n3@gmail.invalid> wrote:
>
>>Julian Lighton wrote:
>>
>>>You've got the source.
>>>
>>>You've presumably got the compilers.
>>
>>Visual Studio 2003? Not on my budget, I bloody well don't.
>
> No, the free compilers you want it to build out of the box with.
>
>>Yet
>>apparently it is needed to cleanly build the Windows port. For shame.
>
> You can do something about it.

I know some C and C++. I don't know beans about porting, and I don't
know the specific code I'd be porting very well either. Find a better
qualified volunteer, or you won't like the results, most likely. :)

--
http://www.gnu.org/philosophy/right-to-read.html
Palladium? Trusted Computing? DRM? Microsoft? Sauron.
"One ring to rule them all, one ring to find them
One ring to bring them all, and in the darkness bind them."
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.angband (More info?)

In article <1omdnTuGeIDhTQvfRVn-1Q@rogers.com>,
Twisted One <twisted0n3@gmail.invalid> wrote:
>Julian Lighton wrote:
>> In article <cKednWW4I4rZVgvfRVn-1g@rogers.com>,
>> Twisted One <twisted0n3@gmail.invalid> wrote:
>>
>>>Julian Lighton wrote:
>>>
>>>>You've got the source.
>>>>
>>>>You've presumably got the compilers.
>>>
>>>Visual Studio 2003? Not on my budget, I bloody well don't.
>>
>> No, the free compilers you want it to build out of the box with.
>>
>>>Yet
>>>apparently it is needed to cleanly build the Windows port. For shame.
>>
>> You can do something about it.
>
>I know some C and C++. I don't know beans about porting, and I don't
>know the specific code I'd be porting very well either. Find a better
>qualified volunteer, or you won't like the results, most likely. :)

Actually, I wouldn't care, as I don't use the OS. (And could probably do
the work if I wanted to.)

You want it done. You have time on your hands. You're supposedly
qualified. (Yes, you may have to do a bit of research, but this isn't
hard stuff.)

Doing it yourself is far more productive than demanding somebody else
do it for you.
--
Julian Lighton jl8e@fragment.com
/* You are not expected to understand this. */
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.angband (More info?)

Larry Bassel a écrit :
> This is likely something Leon and/or Scott can answer:
>
> How do you compile the Sangband source for windows to produce the
> released windows sangband.exe (i.e what compiler/tools)?
>
> I can compile the Sangband source using Cygwin (with a little bit
> of change to the makefile and main-win.c) and run it (once the
> font files are in the right place) from a Cygwin shell without any
> problems, but if I try to run it from the Run menu, it complains that it
> can't find CYGWIN1.DLL. My guess is that this file provides the main()
> (and maybe other things) for the program as there isn't one in main-win.c
> or any other file.
>
> The sangband.exe that comes with the release doesn't have this problem.
> How do I get the executable I make to not need CYGWIN1.DLL or other
> files that Windows (Windows 98 in my case) doesn't have?
>
> Thanks.
>
> Larry

You can probably compile it with MinGW32. I was able to cross compile
angband that way already :)
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.angband (More info?)

In article <d764o8$6p8$1@news.vol.cz>, jodywm@gmail.com says...
> On 2005-05-27 05:19:50, Larry Bassel <labbmf@ix.netcom.com> wrote:
>
> > How do I get the executable I make to not need CYGWIN1.DLL or other
> > files that Windows (Windows 98 in my case) doesn't have?
>
> If you compile in Cygwin, there's no way to produce an executable that doesn't
> require the cygwin1.dll file (as far as I know).
>
> You can just copy it from /usr/bin/cygwin1.dll and distribute it along with the
> exe. As long as it's in the current directory, the program should execute.

Yes, that worked (after some more work on main-win.c as it thought there
was a savefile named ' ' when there wasn't any savefile which caused the
program to get upset). Unfortunately, cygwin1.dll is over 1Mb long.
>
> If you want to produce a standalone exe I'd suggest compiling with LCC:
> http://www.cs.virginia.edu/~lcc-win32/

Thanks, I'll look into this.
>
> cheers
> jm
>

Larry
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.angband (More info?)

In article <MPG.1d010719f74032c99896dd@news.east.earthlink.net>,
labbmf@ix.netcom.com says...
> >
> > If you want to produce a standalone exe I'd suggest compiling with LCC:
> > http://www.cs.virginia.edu/~lcc-win32/
>
> Thanks, I'll look into this.

This worked very well. It took all of 20 minutes to download it, install
it, tweak the makefile and rebuild (and it ran OK). The same slightly
changed source that I used with the Cygwin tools yesterday was usable
with lcc.

This was the first compiler I tried, since it seemed smaller and simpler
than MS Visual Studio or MinGW32 and I don't need (or want) an IDE
(vim and make in either a MSDOS window or a Cygwin shell are what I use).

Thanks a lot Jody!

Larry
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.angband (More info?)

In article <MPG.1d012deb48d4df369896de@news.east.earthlink.net>,
labbmf@ix.netcom.com says...
> In article <MPG.1d010719f74032c99896dd@news.east.earthlink.net>,
> labbmf@ix.netcom.com says...
> > >
> > > If you want to produce a standalone exe I'd suggest compiling with LCC:
> > > http://www.cs.virginia.edu/~lcc-win32/
> >
> > Thanks, I'll look into this.
>
> This worked very well. It took all of 20 minutes to download it, install
> it, tweak the makefile and rebuild (and it ran OK). The same slightly
> changed source that I used with the Cygwin tools yesterday was usable
> with lcc.
>
Sorry to follow up my own post, but I'd like to note that the exact
source as was in the Sangband source distribution (i.e. without any of
the changes I made to make it work with Cygwin) compiled and ran
correctly using lcc.

Larry
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.angband (More info?)

Larry Bassel wrote:

>
> The sangband.exe that comes with the release doesn't have this
> problem. How do I get the executable I make to not need CYGWIN1.DLL
> or other files that Windows (Windows 98 in my case) doesn't have?
>

If you have the full GCC set installed, add -mno-cygwin to the compile
flags. You will need a recent copy of MSVCRT.dll on your system
somewhere instead of cygwin1.dll.

Better would be to add the cygwin directory to your path, though.
Windows can't find it because it doesn't know where to look.
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.angband (More info?)

jodym wrote:

> You can just copy it from /usr/bin/cygwin1.dll and distribute it
> along with the exe. As long as it's in the current directory, the
> program should execute.
>

Just as a note: if you do this you are required by the GPL to
distribute the Cygwin sources by the same method that you distribute
your own. This is something that a few variants that use Cygwin as
their primary Windows compile method have failed to do (Angband/64 and
Multiband both did in the past).
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.angband (More info?)

Twisted One wrote:

>
> This is counter to the spirit of free software. There should be a
> version of the sources + makefile that compiles cleanly with mingw or
> lcc-win32 without any hand-hacking needed IMO.

It does compile cleanly with MingW. And Cygwin will compile against
MSVCRT instead of Cygwin, if all of the gcc compilers are installed.
And you have to have the dll required by the program to run the Cygwin
port of gcc in the first place. And every compiler is going to require
some sort of C-runtime, be it Visual Studio (VBRUN.dll and/or
MSVCRT.dll), gcc (glibc or newlib (which is built into cygwin1.dll on
Cygwin), except the MingW port, which uses MSVCRT.dll).
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.angband (More info?)

Arturus Magi wrote:
> It does compile cleanly with MingW.

That's not what the original poster said. They said there were makefile
and .c file changes needed to compile it with something other than
Visual Studio (bletch) 2003.

> And Cygwin will compile against
> MSVCRT instead of Cygwin, if all of the gcc compilers are installed.
> And you have to have the dll required by the program to run the Cygwin
> port of gcc in the first place. And every compiler is going to require
> some sort of C-runtime, be it Visual Studio (VBRUN.dll and/or
> MSVCRT.dll), gcc (glibc or newlib (which is built into cygwin1.dll on
> Cygwin), except the MingW port, which uses MSVCRT.dll).

The DLL windows users already have being MSVCRT. Better to need a DLL
everyone already has, than to need to distribute another with an
executable, which contributes to DLL bloat and whose license might
impact your freedom of license and distribution.

--
http://www.gnu.org/philosophy/right-to-read.html
Palladium? Trusted Computing? DRM? Microsoft? Sauron.
"One ring to rule them all, one ring to find them
One ring to bring them all, and in the darkness bind them."
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.angband (More info?)

Twisted One wrote:

> Arturus Magi wrote:
> > It does compile cleanly with MingW.
>
> That's not what the original poster said. They said there were
> makefile and .c file changes needed to compile it with something
> other than Visual Studio (bletch) 2003.
>

There are separate makefiles for Windows with Windows Console as the
target (makefile.win, on most Angband variants this is MSVC 6 or later,
but some use bcc or lcc), Cygwin with Windows console as target
(makefile.cyg, this is usually a MingW target, but some change that to
gain the advantage of APIs and functions that don't exist on Windows),
and Cygwin with Cygwin/X as target (makefile.std, same as for POSIX
with local target).

The second compiled cleanly in the past with the addition of the
-mno-cygwin compiler flag, although I haven't checked with current
version, and the later should work on most systems with a working gcc
port and appropriate libraries for one of the compile-time settings in
the file (the X server being the tricky one for a MingW target, but the
X server doesn't have to be MingW itself, and since the original poster
was using Cygwin, Cygwin/X is an obvious possibility. W11 is another,
although it adds a new dll dependency, libw11, to map X11 calls to GDI+
calls).

C file changes are not needed at all, and makefile changes are only
necessary in unusual circumstances.

> The DLL windows users already have being MSVCRT.
> Better to need a DLL everyone already has,

But can you guarantee it's of a compatible version? MSVCRT is not
exactly well known for backward compatibility.

than to need to distribute another with an
> executable, which contributes to DLL bloat and whose license might
> impact your freedom of license and distribution.

Don't distribute the DLL yourself. It causes too many problems, even
without involving third-party software. Library version clash is a
very common occurance just with the existing Windows redistributable
libraries, and only with Microsoft-written programs installed. (Not to
mention sixteen million copies of MSVCRT.dll and VBRUN.dll floating
around your hard drive because nearly every program you install uses
their own copy in an attempt to prevent library version clash.)

If you distribute a Cygwin version of the program, simply require an
existing Cygwin installation. This also releases you, to some point,
from having to troubleshoot Cygwin itself: the Cygwin developers won't
support anything but their own installation methods, and with good
reason. There are too many webpages and third-party programs using
Cygwin out there with installation directions that can, and usually
will, cause severe problems if followed.