Re: [sigrok-devel] [libserialport] Errors building on Windows

2018-02-10 Thread Uwe Hermann
Hi,

On Thu, Feb 08, 2018 at 05:17:36PM +0100, Giorgio Rusconi wrote:
> I am trying to build libserialport on a Windows 10 machine with MSYS2.

This builds fine for me, no issues. Are you sure you have a correct
and somewhat recent MSYS2 setup? Are you sure you build inside either
the "MSYS2 MinGW 64-bit" or the "MSYS2 MinGW 32-bit" shell as per docs?
The "MSYS2 MSYS" shell will not work.

If in doubt, check the "env | grep MSYS" and "env | grep MINGW" output.
If e.g. MSYSTEM_CHOST is "x86_64-pc-msys" that's the "MSYS2 MSYS" shell
and it will not work.


Cheers, Uwe.
-- 
http://hermann-uwe.de | http://randomprojects.org | http://sigrok.org

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
sigrok-devel mailing list
sigrok-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sigrok-devel


[sigrok-devel] [libserialport] Errors building on Windows

2018-02-08 Thread Giorgio Rusconi
Hi there,
I am trying to build libserialport on a Windows 10 machine with MSYS2.

The ./autogen.sh and ./configure steps complete without errors.

When issuing the make command I get the following errors:

make  all-am
  CC   serialport.lo
serialport.c: In function ‘sp_get_port_by_name’:
serialport.c:85:14: warning: implicit declaration of function ‘realpath’ 
[-Wimplicit-function-declaration]
  char *res = realpath(portname, pathbuf);
  ^~~~
serialport.c:85:14: warning: initialization makes pointer from integer 
without a cast [-Wint-conversion]
serialport.c: In function ‘sp_blocking_write’:
serialport.c:811:2: error: unknown type name ‘fd_set’
  fd_set fds;
  ^~
serialport.c:821:3: warning: implicit declaration of function ‘timeradd’ 
[-Wimplicit-function-declaration]
   timeradd(, , );
   ^~~~
serialport.c:824:2: warning: implicit declaration of function ‘FD_ZERO’ 
[-Wimplicit-function-declaration]
  FD_ZERO();
  ^~~
serialport.c:825:2: warning: implicit declaration of function ‘FD_SET’ 
[-Wimplicit-function-declaration]
  FD_SET(port->fd, );
  ^~
serialport.c:836:8: warning: implicit declaration of function ‘timercmp’ 
[-Wimplicit-function-declaration]
if (timercmp(, , >))
^~~~
serialport.c:836:29: error: expected expression before ‘>’ token
if (timercmp(, , >))
 ^
serialport.c:839:4: warning: implicit declaration of function ‘timersub’ 
[-Wimplicit-function-declaration]
timersub(, , );
^~~~
serialport.c:841:12: warning: implicit declaration of function ‘select’ 
[-Wimplicit-function-declaration]
   result = select(port->fd + 1, NULL, , NULL, timeout_ms ?  : 
NULL);
^~
serialport.c: In function ‘sp_blocking_read’:
serialport.c:1037:2: error: unknown type name ‘fd_set’
  fd_set fds;
  ^~
serialport.c:1062:29: error: expected expression before ‘>’ token
if (timercmp(, , >))
 ^
serialport.c: In function ‘sp_blocking_read_next’:
serialport.c:1174:2: error: unknown type name ‘fd_set’
  fd_set fds;
  ^~
serialport.c:1199:29: error: expected expression before ‘>’ token
if (timercmp(, , >))
 ^
serialport.c: In function ‘sp_output_waiting’:
serialport.c:1334:22: error: ‘TIOCOUTQ’ undeclared (first use in this 
function)
  if (ioctl(port->fd, TIOCOUTQ, _waiting) < 0)
  ^~~~
serialport.c:1334:22: note: each undeclared identifier is reported only 
once for each function it appears in
serialport.c: In function ‘sp_wait’:
serialport.c:1502:29: error: expected expression before ‘>’ token
if (timercmp(, , >)) {
 ^
serialport.c:1507:57: error: expected expression before ‘>’ token
if ((timeout_overflow = timercmp(, _delta, >)))
 ^
make[1]: *** [Makefile:527: serialport.lo] Error 1
make: *** [Makefile:398: all] Error 2

How can I fix those errors?
Regards,
Giorgio

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
sigrok-devel mailing list
sigrok-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sigrok-devel