当我运行catkin_make_isolated时,我正试图在windows中用https://github.com/ms-iot/husky/tree/melodic-devel,but的repo从源代码构建赫斯基,windows无法构建它,因为赫斯基使用了"unistd.h“,并且我无法在windows中获得那个头文件,有没有解决这个问题的办法?
错误: cmake处理catkin包:使用env:'C:\Users\catkin_ws\devel_isolated\husky_msgs\env.bat‘生成文件的’==>‘生成文件存在,正在跳过显式husky_base调用...'C:\Users\catkin_ws\build_isolated\husky_base‘中的==> nmake cmake_check_build_system
Microsoft (R)程序维护实用程序版本14.25.28614.0版权所有(C) Microsoft Corporation。版权所有。
'C:\Users\catkin_ws\build_isolated\husky_base‘中的==> nmake
Microsoft (R)程序维护实用程序版本14.25.28614.0版权所有(C) Microsoft Corporation。版权所有。
11%生成目标文件17%生成CXX对象unistd.cl:命令行警告CMakeFiles/horizon_legacy.dir/src/horizon_legacy/Logger.cpp.obj :忽略未知选项'-std=c++11‘C:\Users\catkin_ws\src\husky\husky_base\src\horizon_legacy\Logger.cpp(50):致命错误C1083:无法打开包含文件:'unistd.h':没有这样的文件或目录NMAKE :致命错误U1077:’C:\PROGRA~2\MICROS~1\2019\COMMUN~1\VC\Tools\MSVC\1425~1.286\bin\Hostx64\x64\cl.exe‘:返回代码'0x2’Stop。Studio\2019\Community\VC\Tools\MSVC\14.25.28610\bin\HostX64\x64\nmake.exe"‘:致命错误U1077:'"C:\Program Files (x86)\Microsoft Visual NMAKE :返回代码'0x2’Stop。Studio\2019\Community\VC\Tools\MSVC\14.25.28610\bin\HostX64\x64\nmake.exe"‘:致命错误U1077:'"C:\Program Files (x86)\Microsoft Visual NMAKE :返回代码'0x2’Stop。使能无法处理包'husky_base':命令''C:\Users\catkin_ws\devel_isolated\husky_msgs\env.bat',‘nmake’返回非零退出状态2
通过运行nmake cd 'C:\Users\catkin_ws\build_isolated\husky_base‘&& 'C:\Users\catkin_ws\devel_isolated\husky_msgs\env.bat’==>重现此错误
命令失败,正在退出。
发布于 2020-07-20 10:58:19
我下载了最新版本的存储库,发现文件'\husky-melodic\husky_base\src\horizon_legacy\Logger.cpp'.中有一个不匹配的#if/#endif对在修改了Logger.cpp文件之后,我成功地构建了存储库。
#include <iostream>
#include <fstream>
#include <signal.h>
#if !defined(_WIN32)
# include <unistd.h>
#else
# include <windows.h>
#endifhttps://stackoverflow.com/questions/61600277
复制相似问题