fatal error C1083: 无法打开包括文件: “unistd.h”: No such file or directory
背景在Windows上源码编译PyBullet,参考Windows Install PyBullet,命令很简单,如下:git clone https://github.com/bulletphysics/bullet3or download and unzip https://github.com/bulletphysics/bullet3/archive/master.zip and then
·
背景
在Windows上源码编译PyBullet,参考Windows Install PyBullet,命令很简单,如下:
git clone https://github.com/bulletphysics/bullet3
or download and unzip https://github.com/bulletphysics/bullet3/archive/master.zip and then:
cd bullet3
python setup.py build
python setup.py install
但是在执行python setup.py build
时报错:
D:\bullet3\examples\ThirdPartyLibs\zlib\gzguts.h(23): fatal error C1083: 无法打开包括文件: “unistd.h”: No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.26.28801\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
解决方案
- 用编辑器(如记事本)打开
bullet3\examples\ThirdPartyLibs\zlib\gzguts.h
文件 - 注释掉
#include <unistd.h>
- 添加:
#include <io.h>
#include <process.h>
- 保存即可
参考
[1] https://stackoverflow.com/questions/22705751/cannot-open-include-file-unistd-h-no-such-file-or-directory
[2] https://www.cnblogs.com/dongling/p/7267784.html
更多推荐
已为社区贡献1条内容
所有评论(0)