Problem in Compiling In Windows
Program NXP P89V51RD2 from your favorite Unix system
Status: Beta
Brought to you by:
xwindows
Hi,
Im a graduate student ,want to do my final semester project on creating a Programmer for 8051 in Windows Enviornment.
Iam very happy to see your program working on p89pgm,but im not able to compile the program on GCC Compiler in Windows.
Please help
Regards
Twashish
C:\Users\Gayatri Shrimali\Desktop\Proj1\main.c|156|error: 'O_NONBLOCK' undeclared (first use in this function)|
Anonymous
I suppose you are trying to modify p89pgm 0.1.0, right? Since line number and filename didn't match.
All versions of p89pgm rely on few POSIX features; one of them is non-blocking I/O flag
O_NONBLOCKwhich makes sure that the program can continuously try reading from the serial port while repeatly writing "U" to it at the same time.As
O_NONBLOCKis a POSIX feature unavailable on Windows, not all compiler toolchain emulate it equally- or most likely, not emulate it at all. So you need to be more specific about which brand of GCC you are using before I can try to help any further. (If you're not sure, rungcc -vand post the output here).And while you're at it, make sure to include
fcntl.hheader file at the beginning of your program, just in an unlikely case that it can fix your problem.Regards,
Nutchanon
P.S. In worst case, you might need to replace all those file functions used for serial port I/O with equivalent Win32 serial port I/O functions.