WSL2安装SystemC执行sudo make时遇Makefile分隔符缺失错误
WSL2安装SystemC时
sudo make触发Makefile错误 执行sudo make时出现如下错误:
Making all in src make[1]: Entering directory '/home/ryans/systemc-2.3.4/src' Makefile:77: *** missing separator. Stop. make[1]: Leaving directory '/home/ryans/systemc-2.3.4/src' make: *** [Makefile:557: all-recursive] Error 1
已排查Stack Overflow上常见的空格/制表符相关解决方案,但涉事的src/Makefile第77行既无空格也无制表符,常规方案不适用。
可行排查方向
- 检查第77行上下文语法:确认该行是否存在未闭合的括号、错误的变量引用、非法字符或命令格式错误
- 重新生成Makefile:若Makefile由
./configure生成,删除当前Makefile及config.cache、config.log等缓存文件,重新执行./configure后再运行make - 转换换行符格式:WSL2环境下可能存在Windows格式换行符(CRLF)导致解析失败,执行
dos2unix src/Makefile转换为Unix格式(LF) - 验证依赖版本:确认
make、gcc等工具版本符合SystemC 2.3.4的要求,部分新版本工具可能存在兼容性问题
内容的提问来源于stack exchange,提问作者albusSimba
相关产品推荐
相关产品推荐

