Compiling Under CygWin/Win64

Jef Driesen jefdriesen at telenet.be
Wed Aug 7 00:58:26 UTC 2013


On 2013-08-06 16:14, Robert Wolfe wrote:
> Good morning all!  Discovered yesterday that there is now an x86_64
> version of Cygwin now available so I decided to try and build
> Subsurface under it, starting with libdivecomputer.

Why are you trying to build libdivecomputer with cygwin? Libdivecomputer 
(and subsurface) have native Windows support, so there is really no need 
to use cygwin's linux emulation layer.

Currently the officially supported platforms are Linux, Windows and Mac 
OS X. It might work on other platforms (like cygwin) too, but that has 
never been tried before (at least not that I'm aware of). I'm happy to 
accept patches for other platforms.

> The automake and make steps worked fine without any errors.  However,
> the make process itself failed as follows:
> 
> serial_posix.c: In function 'serial_open':
> serial_posix.c:114:25: error: 'TIOCEXCL' undeclared (first use in this 
> function)
> if (ioctl (device->fd, TIOCEXCL, NULL) != 0) {
> ^
> serial_posix.c:114:25: note: each undeclared identifier is reported
> only once for each function it appears in
> 
> serial_posix.c: In function 'serial_get_transmitted':
> serial_posix.c:753:25: error: 'TIOCOUTQ' undeclared (first use in this 
> function)
> if (ioctl (device->fd, TIOCOUTQ, &bytes) != 0) {
> ^
> Makefile:528: recipe for target `serial_posix.lo' failed

Apparently, the cygwin headers don't define the TIOCEXCL and TIOCOUTQ 
constants. Since these two features are not strictly required to build a 
functional libdivecomputer library, you could try to disable those 
calls. But even then, I can't guarantee libdivecomputer will work fine 
through the cygwin emulation layer.

> Any and all suggestions would be greatly appreciated as I do not know
> where the problem lies here or if I should try the latest source code
> from the git repo?

Have a look at the mingw toolchain [1] instead of cygwin. It's a gcc 
based toolchain for Windows which can build applications using the 
native Windows api. I use it for the official Windows builds too (as a 
linux hosted cross-compiler).

[1] http://www.mingw.org/

Jef


More information about the subsurface mailing list