我一直在尝试使用 cmake 在 docker 中编译一个项目。但是,我收到以下错误:
cmake: /build/cmake-pCygIN/cmake-3.13.4/Source/cmOutputConverter.cxx:125: static std::__cxx11::string cmOutputConverter::ForceToRelativePath(const string&, const string&): Assertion `local_path.empty() || local_path[local_path.size() - 1] != '/'' failed.
这是使用以下 Dockerfile,用于 helloworld c 脚本
WORKDIR .
COPY ./ ./
RUN apt-get update && apt-get -y install cmake
WORKDIR ./build
RUN  cmake ..  && make
cmake 命令在我的家庭环境中运行良好。我认为这是因为我还没有在 docker 环境中安装一些东西,但我不确定它会是什么。
如果其他人遇到此问题,则问题是在根目录中运行 cmake。将所有代码移动到一个./src/文件中,并将 dockerfile 更改为:
FROM python:3.7
WORKDIR .
COPY ./ ./
RUN apt-get update && apt-get -y install cmake
WORKDIR ./build
RUN  cmake ../src  && make
修复了问题
| 归档时间: | 
 | 
| 查看次数: | 341 次 | 
| 最近记录: |