Error building S-Function due to missing termios.h library

11 次查看(过去 30 天)
I am trying to generate code from Simulink to Zybo z10, where I have a linux image. For this, I have done an S-function in c to use the uart in zybo, and I need termios.h to do so. I have tried using MinGW64 Compiler and Visual Studio 2017, and none of them have <termios.h>.
I have tried to do a script in c and compile it with linaro, to execute it in the zybo, and it works. Therefore, I tried to add the termios.h library located in linaro as a header file, but this doesn't work.
If someone knows how to fix this problem, let me know please.
Thank you.

回答(1 个)

Pratyay Pande
Pratyay Pande 2021-8-25
Hi,
The termios.h file helps provide the terminal interface for POSIX compatibility. MinGW does not fully support POSIX and hence termios.h is missing. Windows does terminal I/O with a very different model from any Linux system and thus, there is no direct equivalent to the termios.h header and its dependencies as of this date.
A few known suggestions to address to this issue can be:
  • port with Cygwin. It provides functionality similar to a Linux distro and addresses the POSIX API incompatibility.
  • use veeso/termiWin which is an open source termios porting for Windows.
  • perhaps a more extreme approach: you can dual-boot or use a virtual machine to install a linux distro and execute your Simulink model there. Please consider this as a last resort. Minimum system requirements to use MATLAB can be found here.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by