Vs2010 - Cannot open file 'sys / param.h

When I compile my solution in C ++ in vs2010 x64 mode, I get the following compilation. Can not open include file 'sys/param.h' :No such file or directory.

But the same compiles in Win32 mode.

I am not sure how this header file is missing. Can someone help me with this? I use some of the client headers, and this is the section below the code that is present in the client file.
#ifndef WIN32
#include <sysipc.h>
#include <sys/param.h>
#endif

+4
source share
2 answers

It is very likely that some of #if wrong - for example, it checks _M_IX86 , and it does not install on a 64-bit system, it raises something non-windows and tries to compile it.

sys/param.h is the unix / linux header file, and you should not expect to find it on your Windows system. [edit: if you are not connected to the GNU compiler version or have not done any other modification in the kernel of the compilation tools of the MSVC build environment]

Unfortunately, without seeing the source code, all we can do is explain the possible reasons ...

+2
source

Include #include <sysipc.h> should be #include <sys/ipc.h> , however this is a POSIX header file for Linux build projects, so it won’t work for any Visual Studio projects. Since you are compiling for x64, by default the WIN32 flags cannot be set.

Try changing the macro to:

 #ifndef _MSC_VER #include <sys/ipc.h> #include <sys/param.h> #endif // !_MSC_VER 

Hope this helps.

+2
source

Source: https://habr.com/ru/post/1497980/


All Articles