Closed Ben-401 closed 3 weeks ago
I believe the readline error will be fixed by re-running cygwin's setup.exe and installing the libreadline-devel package.
As for the FIONREAD error, I'll look into that now and try figure out which package it belongs to and get back to you.
The only other mystery left is what package is needed for that "FIONREAD" stuff...
I used grep inside my cygwin's "/usr/include" folder to try locate which include-files refer to this FIONREAD...
I then use a 'cygcheck' tool to figure out which packages those include files referred to.
The tool reports that the likely packages needed are:
cygwin64
cygwin64-w32api-headers
Anyway, try running cygwin's setup.exe and installing that latter package, and hopefully that FIONREAD error will go away too. If not, let me know and we can investigate it further.
Search led me here first; found a solution over at sourceforge. Just wanted to drop a link for the next person who gets stuck with FIONREAD when compiling some C on cygwin: Serial Port Programming in C++
Possible solution:
#ifndef FIONREAD // cygwin defines FIONREAD in socket.h instead of ioctl.h
#include <sys/socket.h>
#endif
Think some solutions have been documented on this ticket, so closing.
also refer to https://groups.google.com/forum/#!topic/c65gs-development/FEVkgRqs8Dg
$ make gcc -c -Wall -g main.c -o main.o main.c:7:31: fatal error: readline/readline.h: No such file or directory compilation terminated. Makefile:24: recipe for target 'main.o' failed make: *\ [main.o] Error 1
$ gcc commands.c gs4510.c main.c serial.c main.c:7:31: fatal error: readline/readline.h: No such file or directory compilation terminated. serial.c: In function ‘serialFlush’: serial.c:118:13: error: ‘FIONREAD’ undeclared (first use in this function) ioctl(fd, FIONREAD, &bytes_available); ^ serial.c:118:13: note: each undeclared identifier is reported only once for each function it appears in