O_NONBLOCK and O_SYNC not declared [mingw]
Closed this issue · 2 comments
Hi,
probably something simple I am missing here. Getting the following error when trying to compile with mingw:
C:\MinGW\msys\1.0\home\i7\xc3sprog\sysfs.cpp: In member function 'int IOSysFsGPI
O::setup_gpio(int, int)':
C:\MinGW\msys\1.0\home\i7\xc3sprog\sysfs.cpp:132:31: error: 'O_NONBLOCK' was not
declared in this scope
int fd = open(buf, O_RDWR | O_NONBLOCK | O_SYNC);
^~~~~~~~~~
~\xc3sprog\sysfs.cpp:132:44: error: 'O_SYNC' was not dec
lared in this scope
int fd = open(buf, O_RDWR | O_NONBLOCK | O_SYNC);
^~~~~~
CMakeFiles\xc3sproglib.dir\build.make:70: recipe for target 'CMakeFiles/xc3sprog
lib.dir/sysfs.cpp.obj' failed
O_NONBLOCK and O_SYNC should be defined in fcntl.h - yet my mingw installation does not. Is there an easy workaround for this?
Thanks a lot!
@FelixVi , Can you please explain the closure for this? I am curious about solution!
I am not sure why this got closed here.
Either way, I was able to find a version elsewhere that compiled fine and that I am now using on Windows.
Let me know if you can‘t find a version that works - mine is now probably about 1 year old.