Subject: Re: clib package under Windows

From: Jan Wielemaker <[email-masked]>
Date: Tue, 21 Nov 2000 12:07:00 +0100

[ replied to mailing list; there are people around knowing a lot more
  about windows then I do

  If someone could start a page on the user-web, a number of users
  would be more happy.
]

> unfortunatley I have to use Windows as platform. I already wrote some
> modules (http client/server) using your clib package under linux. Can
> you give me any hints how to port the clib package to windows. More
> precise:
> 
> - what C compiler do I need, will gcc for windows work?

SWI-Prolog is compiled using MSVC 5.0.  Any compiler that can produce
DLLs with the same calling conventions (the foreign interface functions
are simply exported which implies, as far as I know, the C-calling
conventions are used) and read the MSVC 5.0 import libraries will
do.  I would assume most compilers try to ensure compatibility to
MSVC in this respect.

Though I'm not sure, I assume compiling SWI-Prolog plcon.exe using
gcc/cygwin should be fairly trivial, given that both are Unix/POSIX
based.

> - as far as I know the unix process management, means fork predicates
> and everything dealing with PIDs will not work under windows. Is there a
> chance to create threads/forks from within SWI under windows?

I've heart rumours cygwin provides fork().  Multi-threading is supported
only using the pthread library.  Don't know whether there is a windows
version.

> - do you have any .dll available, that really would minimize my effort.

Only the socket interface compiles without problems on msvc.  The
CGI interface should be trivial too.  The rest is very Unix/POSIX
specific and if cygwin provides not enough you really need to start
reconsidering your design at higher level.

	--- Jan