[rttopo-dev] Compile errors with Visual Studio 2012

a.furieri at lqt.it a.furieri at lqt.it
Tue Jun 27 01:25:13 PDT 2017


On Mon, 26 Jun 2017 10:57:41 -0300, Jeff McKenna wrote:
> Hi all,
>
> I am trying to add librttopo support on Windows (for spatialite) for
> the MS4W community, and when I try to compile librttopo master I get
> the following errors with Visual Studio 2012:
>
>   https://git.osgeo.org/gogs/rttopo/librttopo/issues/24
>
> Please let me know if you need any more info, I can add it here or in
> the ticket.
>

Hi Jeff,

I've just been able to successfully build librttopo on MSVC 2015
(I imagine it should work on earlier versions of MSVC as well).
here is the basic recipe I've followed:

1. I've downloaded the most recent version of the sources
    available from the GIT repository:
    https://git.osgeo.org/gogs/rttopo/librttopo/archive/master.zip

2. then, from the MSVC own command prompt I've executed:
    nmake /f makefile.vc >msvc-log.txt

ouch ... the build process stops prematurely because two
header files are missing (both them are usually auto-generated
on the fly by the ./configure script on Linux).

so I've simply copied what I already had from a previous MinGW
build session (you'll find both headers into the attachment):

-/src/rttopo_config.h
-/headers/librttopo_geom.h

3. once again:
    nmake /f makefile.vc >msvc-log.txt

and I was finally able to successfully complete my MSVC build.

NOTE: as you can easily check from the attached "msvc-log.txt"
there are plenty of warnings (variables declared but never
used, not-casted conversions from signed and unsigned values,
not-ncasted roundings/truncations from doubles and floats and
alike).

more or less the same identical issues are reported by MinGW
and by GCC as well (see "mingw-log.txt"), so I intend that
all them should be simply considered as symptoms of a someway
"dirty" code, but they should be rather harmless.

please let me know if the same recipe works for you on
MSVC 2012; if yes I'll then try to patch the code so to
properly support a clean MSVC build.

I'm basically thinking about a solution like:

#if defined(_WIN32) && !defined(__MINGW32__)
#include "librttopo_geom_msvc.h"
#else
#include "librttopo_geom.h"
#endif

bye Sandro



More information about the librttopo-dev mailing list