系统调用- sys /系统调用。h -不是这样的文件或目录。

时间:2022-05-01 06:26:10

Where can i find this library? The compiler reports me: "Not such file or directory"... I want to call the syscall function included in this library...

我在哪里可以找到这个图书馆?编译器报告我:“不是这样的文件或目录”……我想调用这个库中包含的syscall函数…

1 个解决方案

#1


2  

Windows does not have a <sys/syscall.h>. If you are trying to port something from Linux to Windows that uses this, then you need something along the lines of:

Windows没有 。如果您试图将一些东西从Linux移植到使用此功能的Windows,那么您需要一些类似的东西:

#if __linux
#include <sys/syscall.h>
#elif defined(_WIN32) || defined(_WIN64)
#include <windows.h>       // Or something like it. 
#endif

Of course, most likely your code also won't compile with these changes alone, you will also have to fix up the code that actually uses the declarations in <sys/syscall.h>, which will highly depend on exactly what that is.

当然,很可能您的代码也不会单独使用这些更改来编译,您还必须修复实际使用 ,这很大程度上取决于它是什么。

If you are not quite familiar with porting code and the project is large, I'd check if someone else has made a windows port of the project, because chances are that you will struggle. There are lots of things in a Unix/Linux environment that is quite different from how Windows works.

如果您对移植代码不太熟悉,并且项目很大,我将检查其他人是否已经做了这个项目的windows端口,因为您可能会遇到困难。在Unix/Linux环境中有很多东西与Windows的工作方式有很大的不同。

#1


2  

Windows does not have a <sys/syscall.h>. If you are trying to port something from Linux to Windows that uses this, then you need something along the lines of:

Windows没有 。如果您试图将一些东西从Linux移植到使用此功能的Windows,那么您需要一些类似的东西:

#if __linux
#include <sys/syscall.h>
#elif defined(_WIN32) || defined(_WIN64)
#include <windows.h>       // Or something like it. 
#endif

Of course, most likely your code also won't compile with these changes alone, you will also have to fix up the code that actually uses the declarations in <sys/syscall.h>, which will highly depend on exactly what that is.

当然,很可能您的代码也不会单独使用这些更改来编译,您还必须修复实际使用 ,这很大程度上取决于它是什么。

If you are not quite familiar with porting code and the project is large, I'd check if someone else has made a windows port of the project, because chances are that you will struggle. There are lots of things in a Unix/Linux environment that is quite different from how Windows works.

如果您对移植代码不太熟悉,并且项目很大,我将检查其他人是否已经做了这个项目的windows端口,因为您可能会遇到困难。在Unix/Linux环境中有很多东西与Windows的工作方式有很大的不同。