Discussion:
[Swig-devel] error compiling with win32
Jeff McKenna
2016-11-29 21:27:50 UTC
Permalink
Hello all,

Disclaimer: I build regularly with Visual Studio, not MinGW/MSYS, so go
easy on me ha.

I am trying to compile SWIG 3.0.10, and have followed the steps in
/doc/manual/windows.html (including running Tools/pcre-build.sh).
However the compile stops on an error (and I actually don't see the
exact error message in the output?). A snippet of the output is below,
or you can see the whole build output at: http://pastebin.com/5zMHi8uW

---
Swig/misc.c: In function `is_directory':
Swig/misc.c:151: storage size of `st' isn't known
Swig/misc.c:156: warning: implicit declaration of function `stat'
Swig/misc.c:161: `S_IFDIR' undeclared (first use in this function)
Swig/misc.c:161: (Each undeclared identifier is reported only once
Swig/misc.c:161: for each function it appears in.)
Swig/misc.c:151: warning: unused variable `st'
Swig/misc.c: In function `Swig_new_subdirectory':
Swig/misc.c:185: warning: implicit declaration of function `_mkdir'
make[2]: *** [Swig/misc.o] Error 1
make[2]: Leaving directory `/src/swig-git-3.0.10/Source'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/src/swig-git-3.0.10/Source'
make: *** [source] Error 2
---

I have tried compiling with master, rel-2.0.12 also....same error. Can
anyone see what I am doing wrong? (or an error message that gives a hint?)

Thanks :)

-jeff
--
Jeff McKenna
MapServer Consulting and Training Services
http://www.gatewaygeomatics.com/





------------------------------------------------------------------------------
Phineas Campbell
2016-11-29 22:05:53 UTC
Permalink
Jeff

I've had a look at making a SWIG version using Visual Studio tools but the
problems looked insurmountable and what is there to gain.

Have you built SWIG on Windows?

Which version of SWIG?

which version of cl and link?

HTH
Phineas

-----Original Message-----
From: Jeff McKenna [mailto:***@gatewaygeomatics.com]
Sent: 29 November 2016 21:28
To: swig-***@lists.sourceforge.net
Subject: [Swig-devel] error compiling with win32

Hello all,

Disclaimer: I build regularly with Visual Studio, not MinGW/MSYS, so go easy
on me ha.

I am trying to compile SWIG 3.0.10, and have followed the steps in
/doc/manual/windows.html (including running Tools/pcre-build.sh).
However the compile stops on an error (and I actually don't see the
exact error message in the output?). A snippet of the output is below,
or you can see the whole build output at: http://pastebin.com/5zMHi8uW

---
Swig/misc.c: In function `is_directory':
Swig/misc.c:151: storage size of `st' isn't known
Swig/misc.c:156: warning: implicit declaration of function `stat'
Swig/misc.c:161: `S_IFDIR' undeclared (first use in this function)
Swig/misc.c:161: (Each undeclared identifier is reported only once
Swig/misc.c:161: for each function it appears in.)
Swig/misc.c:151: warning: unused variable `st'
Swig/misc.c: In function `Swig_new_subdirectory':
Swig/misc.c:185: warning: implicit declaration of function `_mkdir'
make[2]: *** [Swig/misc.o] Error 1
make[2]: Leaving directory `/src/swig-git-3.0.10/Source'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/src/swig-git-3.0.10/Source'
make: *** [source] Error 2
---

I have tried compiling with master, rel-2.0.12 also....same error. Can
anyone see what I am doing wrong? (or an error message that gives a hint?)

Thanks :)

-jeff


--
Jeff McKenna
MapServer Consulting and Training Services http://www.gatewaygeomatics.com/





----------------------------------------------------------------------------
--
_______________________________________________
Swig-devel mailing list
Swig-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/swig-devel


------------------------------------------------------------------------------
Jeff McKenna
2016-11-30 15:23:05 UTC
Permalink
Hello Phineas,

To be honest this is the first time I am trying to build SWIG on Windows
(I do regularly build software on Windows, but with the Visual Studio
compiler). However in this case, I am following the "Building swig.exe
using MinGW and MSYS" section of the steps from the document
/Doc/Manual/Windows.html Here is some more information for you:

- tried building with SWIG versions: git master, rel-3.0.10,
rel-2.0.12 (all give that same error)

- gcc --version
3.2.3 (mingw special 20030504-1)

Again, this is with MinGW/MSYS.

If you see any hints in my error messages, please let me know :) Thanks!

-jeff
Post by Phineas Campbell
Jeff
I've had a look at making a SWIG version using Visual Studio tools but the
problems looked insurmountable and what is there to gain.
Have you built SWIG on Windows?
Which version of SWIG?
which version of cl and link?
HTH
Phineas
-----Original Message-----
Sent: 29 November 2016 21:28
Subject: [Swig-devel] error compiling with win32
Hello all,
Disclaimer: I build regularly with Visual Studio, not MinGW/MSYS, so go easy
on me ha.
I am trying to compile SWIG 3.0.10, and have followed the steps in
/doc/manual/windows.html (including running Tools/pcre-build.sh).
However the compile stops on an error (and I actually don't see the
exact error message in the output?). A snippet of the output is below,
or you can see the whole build output at: http://pastebin.com/5zMHi8uW
---
Swig/misc.c:151: storage size of `st' isn't known
Swig/misc.c:156: warning: implicit declaration of function `stat'
Swig/misc.c:161: `S_IFDIR' undeclared (first use in this function)
Swig/misc.c:161: (Each undeclared identifier is reported only once
Swig/misc.c:161: for each function it appears in.)
Swig/misc.c:151: warning: unused variable `st'
Swig/misc.c:185: warning: implicit declaration of function `_mkdir'
make[2]: *** [Swig/misc.o] Error 1
make[2]: Leaving directory `/src/swig-git-3.0.10/Source'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/src/swig-git-3.0.10/Source'
make: *** [source] Error 2
---
I have tried compiling with master, rel-2.0.12 also....same error. Can
anyone see what I am doing wrong? (or an error message that gives a hint?)
Thanks :)
-jeff
------------------------------------------------------------------------------
Eric Ehlers
2016-11-30 14:53:21 UTC
Permalink
I forked SWIG and resurrected the Visual Studio build. I do not
remember having any difficulty with it. I am using Visual Studio 2008,
also known as VC9. Here is my fork:

https://github.com/eehlers/swig
Post by Jeff McKenna
Swig/misc.c:161: `S_IFDIR' undeclared (first use in this function)
Here is the fix for that:

#ifdef _WIN32
#include <direct.h>
#ifndef S_ISDIR
#define S_ISDIR(mode) (((mode) & S_IFDIR) == S_IFDIR)
#endif
#endif
Post by Jeff McKenna
Swig/misc.c:185: warning: implicit declaration of function `_mkdir'
Here is the fix for that:

#ifdef _WIN32
result = _mkdir(Char(dir));
#else
result = mkdir(Char(dir), 0777);
#endif

You might need some additional #includes as well, and there might be
other fixes for the other warnings you saw. You could diff your misc.c
or repo against mine. I have been using the VC build for a very long
time with no trouble.

Regards,
Eric

------------------------------------------------------------------------------
Phineas Campbell
2016-11-30 16:09:15 UTC
Permalink
If you had made some progress building SWIG using Microsoft tools I might
have been prepared to pitch in just to get you over the hump

I use Swig on both Linux and Windows and build it from the source in Linux,
without many problems, but download the binaries for Windows

I have never tried the Windows build as my experience of the GCC Windows
tools has not been great. I feel a bit guilty about this as my hunch is
that Windows is the primary platform and there are a limited number of users
with the knowledge of the GCC Windows build.

I think it is important culturally that FOSS projects are maintained and
extended in a Linux world so a Windows fork would not be a good idea

If there is a compelling reason why a Visual Studio build is necessary I
might think again

All the best

Phineas



-----Original Message-----
From: Jeff McKenna [mailto:***@gatewaygeomatics.com]
Sent: 30 November 2016 15:23
To: swig-***@lists.sourceforge.net
Subject: Re: [Swig-devel] error compiling with win32

Hello Phineas,

To be honest this is the first time I am trying to build SWIG on Windows (I
do regularly build software on Windows, but with the Visual Studio
compiler). However in this case, I am following the "Building swig.exe
using MinGW and MSYS" section of the steps from the document
/Doc/Manual/Windows.html Here is some more information for you:

- tried building with SWIG versions: git master, rel-3.0.10,
rel-2.0.12 (all give that same error)

- gcc --version
3.2.3 (mingw special 20030504-1)

Again, this is with MinGW/MSYS.

If you see any hints in my error messages, please let me know :) Thanks!

-jeff
Post by Phineas Campbell
Jeff
I've had a look at making a SWIG version using Visual Studio tools but
the problems looked insurmountable and what is there to gain.
Have you built SWIG on Windows?
Which version of SWIG?
which version of cl and link?
HTH
Phineas
-----Original Message-----
Sent: 29 November 2016 21:28
Subject: [Swig-devel] error compiling with win32
Hello all,
Disclaimer: I build regularly with Visual Studio, not MinGW/MSYS, so
go easy on me ha.
I am trying to compile SWIG 3.0.10, and have followed the steps in
/doc/manual/windows.html (including running Tools/pcre-build.sh).
However the compile stops on an error (and I actually don't see the
exact error message in the output?). A snippet of the output is below,
or you can see the whole build output at: http://pastebin.com/5zMHi8uW
---
Swig/misc.c:151: storage size of `st' isn't known
Swig/misc.c:156: warning: implicit declaration of function `stat'
Swig/misc.c:161: `S_IFDIR' undeclared (first use in this function)
Swig/misc.c:161: (Each undeclared identifier is reported only once
Swig/misc.c:161: for each function it appears in.)
Swig/misc.c:151: warning: unused variable `st'
Swig/misc.c:185: warning: implicit declaration of function `_mkdir'
make[2]: *** [Swig/misc.o] Error 1
make[2]: Leaving directory `/src/swig-git-3.0.10/Source'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/src/swig-git-3.0.10/Source'
make: *** [source] Error 2
---
I have tried compiling with master, rel-2.0.12 also....same error. Can
anyone see what I am doing wrong? (or an error message that gives a hint?)
Thanks :)
-jeff
----------------------------------------------------------------------------
--
_______________________________________________
Swig-devel mailing list
Swig-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/swig-devel


------------------------------------------------------------------------------
Jeff McKenna
2016-11-30 17:22:27 UTC
Permalink
Hi Phineas,

Update: I started over again, this time not following the steps
precisely in the "Building swig.exe using MinGW and MSYS" section, but
using more uptodate versions of MinGW and MSYS, and also adding in many
other required libraries (that are not mentioned in those docs, such as
pkg-config). I was able to compile SWIG 3.0.10 !

Thank you Eric for sharing the Visual Studio fork, I'll also give that a
try.


-jeff
--
Jeff McKenna
President Emeritus, OSGeo Foundation
http://wiki.osgeo.org/wiki/Jeff_McKenna
Post by Phineas Campbell
If you had made some progress building SWIG using Microsoft tools I might
have been prepared to pitch in just to get you over the hump
I use Swig on both Linux and Windows and build it from the source in Linux,
without many problems, but download the binaries for Windows
I have never tried the Windows build as my experience of the GCC Windows
tools has not been great. I feel a bit guilty about this as my hunch is
that Windows is the primary platform and there are a limited number of users
with the knowledge of the GCC Windows build.
I think it is important culturally that FOSS projects are maintained and
extended in a Linux world so a Windows fork would not be a good idea
If there is a compelling reason why a Visual Studio build is necessary I
might think again
All the best
Phineas
-----Original Message-----
Sent: 30 November 2016 15:23
Subject: Re: [Swig-devel] error compiling with win32
Hello Phineas,
To be honest this is the first time I am trying to build SWIG on Windows (I
do regularly build software on Windows, but with the Visual Studio
compiler). However in this case, I am following the "Building swig.exe
using MinGW and MSYS" section of the steps from the document
- tried building with SWIG versions: git master, rel-3.0.10,
rel-2.0.12 (all give that same error)
- gcc --version
3.2.3 (mingw special 20030504-1)
Again, this is with MinGW/MSYS.
If you see any hints in my error messages, please let me know :) Thanks!
-jeff
Post by Phineas Campbell
Jeff
I've had a look at making a SWIG version using Visual Studio tools but
the problems looked insurmountable and what is there to gain.
Have you built SWIG on Windows?
Which version of SWIG?
which version of cl and link?
HTH
Phineas
-----Original Message-----
Sent: 29 November 2016 21:28
Subject: [Swig-devel] error compiling with win32
Hello all,
Disclaimer: I build regularly with Visual Studio, not MinGW/MSYS, so
go easy on me ha.
I am trying to compile SWIG 3.0.10, and have followed the steps in
/doc/manual/windows.html (including running Tools/pcre-build.sh).
However the compile stops on an error (and I actually don't see the
exact error message in the output?). A snippet of the output is below,
or you can see the whole build output at: http://pastebin.com/5zMHi8uW
---
Swig/misc.c:151: storage size of `st' isn't known
Swig/misc.c:156: warning: implicit declaration of function `stat'
Swig/misc.c:161: `S_IFDIR' undeclared (first use in this function)
Swig/misc.c:161: (Each undeclared identifier is reported only once
Swig/misc.c:161: for each function it appears in.)
Swig/misc.c:151: warning: unused variable `st'
Swig/misc.c:185: warning: implicit declaration of function `_mkdir'
make[2]: *** [Swig/misc.o] Error 1
make[2]: Leaving directory `/src/swig-git-3.0.10/Source'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/src/swig-git-3.0.10/Source'
make: *** [source] Error 2
---
I have tried compiling with master, rel-2.0.12 also....same error. Can
anyone see what I am doing wrong? (or an error message that gives a hint?)
Thanks :)
-jeff
----------------------------------------------------------------------------
--
_______________________________________________
Swig-devel mailing list
https://lists.sourceforge.net/lists/listinfo/swig-devel
------------------------------------------------------------------------------
Continue reading on narkive:
Loading...