Complete.Org: Mailing Lists: Archives: freeciv-dev: June 2002:
[Freeciv-Dev] Re: compile on windows and possible bug with map size
Home

[Freeciv-Dev] Re: compile on windows and possible bug with map size

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: compile on windows and possible bug with map size
From: Christian Stock <cstock@xxxxxxxxxxxxxx>
Date: Tue, 25 Jun 2002 19:14:00 +1000

Thanks for all the help!

I fixed the config.h for msvc and it seems to work (I had to undefine a few things).

Added the HAVE_CONFIG_H as compile option, pretty easy, thanks for that.

Replaced the S_ISREG with what's in the macro. Works fine... (stupid to take the S_ISREG out of the stat.h in the first place, but oh well). Maybe it would be good to insert a #ifdef W32_NATIVE and then replace the S_ISREG with whats in the macro, or make a new #ifdef W32_MSVC...

So, now I'm stuck with the last error _beginthreadex. I mostly worked it out. MSVC includes a few default libs, one of them is libc.lib which is for single threading. _beginthreadex is in the multi-thread lib libcmt.lib. So I just had to exclude the libc.lib. Not too hard. However, now errno isn't defined anymore. Probably it's in the libc.lib, but not in the libcmt.lib. I wish M$ would stop doing this sort of brain damaged stuff. Any clues on that?

This really should be the last error, but then there's still a chance that the server (once it's built) will just crash on me...

Cheers, Christian



At 02:12 AM 25/06/2002 +0000, you wrote:
On Mon, 24 Jun 2002 10:57:39 +1000, Christian Stock
<cstock@xxxxxxxxxxxxxx> wrote:

>Hi,
>
>I'm trying to compile the cvs freeciv version for win (from yesterday) on
>my home box (which doesn't have linux anymore, because I ran out of
>diskspace and was using linux for work only).
>
>The reason why I want to compile it is because the win cvs (and the 1.12.0
>version) crashes on a custom made map. I basically doubled the large earth
>map (so it's 320x180 now). I need that sort of detail and size for a
>scenario I'm making. It seems to be too big, although in the code it looks
>like maps can be as big as they want to be, so I suspect a bug in the win
>client. So I wanted to fix it :)
>
>I'm using MSVC 6.0, and I got really close compiling the server yesterday.
>First off, since I'm using MSVC, I was stuck with the autogen.sh. Although
>I have lot's of programming experience, I'm not very good when it come to
>setting things up. I know that I need a config.h and I have worked out a
>few things on what I need to define and what not, but I have a few
>problems. Can someone maybe post a working config.h for a win system? And
>where do I include it, ie where do I define HAVE_CONFIG_H?

Not sure. Rarely use VC. You effectively want "-DHAVE_CONFIG_H" added
into its equivilent of "CFLAGS" so somewhere in Project->Settings->C/C++
I expect. Either or both of [Preprocessor Options]/[Project Options]?

>I defined the
>win variables in the individual header files which is of course not ideal
>at all, but it worked to get most stuff compiled for now...
>
>my linking still has 2 problems. When I define NATIVE_WIN (which assume I
>should), the code uses _beginthreadex, which is undefined.

WIN32_NATIVE?

>If I include the
>libraries libcmt.lib or msvcrt.lib, I get conflicts, so what do i do?

It's not still sat in C++ mode somehow is it? Long shot that.

>also, S_ISREG is undefined. It doesn't seem to be windows related, so how
>do i fix that?

Ought to be in <sys/stat.h> but those macros are "accidentally" omitted
from VC even though the flags with which to implement them are there
*but* iirc (and I may not) those flags are posix ones and won't work
properly for all win32 variants.

You should be okay with S_ISREG though: copy the ming32 <sys/stat.h>...

#define _S_IFREG        0x8000  /* Regular */
#define _S_IFMT         0xF000  /* File type mask */
#define _S_ISREG(m)     (((m) & _S_IFMT) == _S_IFREG)

...but do test it!


--
swamp-dog@xxxxxxxxxxxx



[Prev in Thread] Current Thread [Next in Thread]