简体   繁体   中英

How to include <sys/select.h> library in a Visual Studio C++ project?

I am a beginner with Visual Studio and now I want to run a C++ program on it, but when I compile the program there is an error that <sys/select.h> is not defined.

So, how can I define it or include it in the project?

sys/select.h is a POSIX header that supports select() ; the equivalent on Win32 only works on sockets, so you are unlikely to get the code working on Windows unless you are already skilled at porting.

The header files (which are not libraries) in the sys directory are system specific - you can't just take code that uses them and works on one platform and compile it on another one. And note that there may very well be no equivalent on the target platform - you may well have to rewrite the code that depends on sys headers.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM