CMake throws Error: could not load cache

2020-06-01 06:34发布

I am trying to build Dlib 19.0 examples. I did

cd examples
mkdir build
cd build
cmake ..
cmake --build 

to get exe now, cmake --build from the examples directory.

CMake throws: Error: could not load cache

Screenshot:

enter image description here

标签: cmake
2条回答
做自己的国王
2楼-- · 2020-06-01 07:15

You could try:

  1. Make sure you have enough space / correct permissions etc for the generated files to be created
  2. Remove all generated files e.g. CmakeCache.txt and re-run cmake ..; check the output carefully for potential issues during this step, missing libraries etc.
查看更多
一纸荒年 Trace。
3楼-- · 2020-06-01 07:29

I guess you didn't configure your project.

  1. You first need to run cmake . at the project root to generate build files. You can also run it from an empty directory to separate source and build files.

  2. Then you can use cmake --build ./ in the build dir.

Or, if you prefer code-only:

cd [root-directory-of-your-project]
cmake .
cmake --build ./
查看更多
登录 后发表回答