[abo: Re: [rproxy-devel] librsync on Windows anyone?]

Donovan Baarda abo@minkirri.apana.org.au
Thu, 18 Apr 2002 20:31:27 +1000


Whups, forgot to Cc...

----- Forwarded message from abo -----

Date: Thu, 18 Apr 2002 20:27:24 +1000
To: rproxy-devel@lists.sourceforge.net
Subject: Re: [rproxy-devel] librsync on Windows anyone?

G'day again,

I'm Cc'ing to the rdiff-backup list this time because they might be
interested. I'm working on compiling librsync under MSVC++, leading
eventualy to librsync Python extension (that works on Windows and unix) as
part of pysync.

On Thu, Apr 18, 2002 at 12:37:43AM +1000, Donovan Baarda wrote:
[...]
> I will submit a patch to librsync when I've got it all working. I am >< this
> far from having a proper autoconf + MSVC working.

I have still not succeeded with autoconf+MSVC, but I'm very close. However,
I have successfuly compiled rdiff.exe using an MSVC++ project. I have
followed the Python approach for doing this, as it is very non-intrusive to
the normal unix code.

I have a PCbuild/ directory off the root that contains the workspace and
project, as well as any VC specific files, including a config.h built by
running a script "configure.msc" under cygwin.

The configure.msc script simply calls configure with options to use VC. I
have put in the source root, as this is useful for doing a full autoconf
make using VC under cygwin (when I get it working). Note that the configure
provided with 0.9.5 needed to be re-generated using the autoconf v2.13
provided with cygwin for it to work.

Some changes were necisary to some source files. I have tried to keep these
to a minium, and wrapped them in appropriate #ifdefs where possible. Once I
clean this up a bit I will be submitting a patch agains 0.9.5 (today or
tomorrow).

[...]
> I now have it to the point where I have compiled everything, and it's
> falling over on the link with;
[...]
>  librsync.a(stats.obj) : error LNK2001: unresolved external symbol _snprintf
>  libpopt.a(popt.obj) : error LNK2001: unresolved external symbol _alloca
>  libpopt.a(poptparse.obj) : error LNK2001: unresolved external symbol _alloca
>  libpopt.a(findme.obj) : error LNK2001: unresolved external symbol _alloca
>  librsync.a(trace.obj) : error LNK2001: unresolved external symbol _vsnprintf
>  rdiff.exe : fatal error LNK1120: 3 unresolved externals
>  
> As far as I can tell, _snprint and _vsnprintf etc, are in the msvcrt.dll,
> which the -MD option should handle, right? 

For the record, I hit similar problems compiling as a VC project, but only
for _alloca. This turns out to be resolved by using #includin <malloc.h> in
the appropriate places. I don't know why a header file would make a
difference to linking, but maybe it's a C++ thing.

I don't know why the cygwin autoconf make using VC had the other missing
symbols, but I still have some things to resolve (like compile options) when
compiling that way. I won't waste too much time on it though as I have the
Python extension to worry about first.

-- 
----------------------------------------------------------------------
ABO: finger abo@minkirri.apana.org.au for more info, including pgp key
----------------------------------------------------------------------

----- End forwarded message -----

-- 
----------------------------------------------------------------------
ABO: finger abo@minkirri.apana.org.au for more info, including pgp key
----------------------------------------------------------------------