Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cmake Error: could not load cache

Tags:

cmake

I'm using Cmake to try to build a project for Eclipse. When I try running Cmake, I get the following error:

Error: could not load cache Error: Batch build stopped due to Eclipse CDT4 - Unix Makefiles error. ---- Time Elapsed: 3 secs ---- Error: could not load cache Error: Batch build stopped due to Eclipse CDT4 - Unix Makefiles error. 

I'm completely stumped on what might be causing this. I know that I'm running Cmake in the correct directory and the CMakeCache.txt file is present. Could someone point me in the right direction to solve this?

like image 261
robhasacamera Avatar asked May 01 '13 13:05

robhasacamera


People also ask

How use CMake command line?

Running CMake from the command line From the command line, cmake can be run as an interactive question and answer session or as a non-interactive program. To run in interactive mode, just pass the option “-i” to cmake. This will cause cmake to ask you to enter a value for each value in the cache file for the project.

How do I compile a CMake project?

Run the cmake executable or the cmake-gui to configure the project and then build it with your chosen build tool. Run the install step by using the install option of the cmake command (introduced in 3.15, older versions of CMake must use make install ) from the command line, or build the INSTALL target from an IDE.

What is CMake build?

CMake is a cross-platform build system generator. Projects specify their build process with platform-independent CMake listfiles included in each directory of a source tree with the name CMakeLists. txt. Users build a project by using CMake to generate a build system for a native tool on their platform.


2 Answers

If you are using the CLion, you can use File---"Reload CMake Project".

I meet this problem after using git force pull, and Reload CMake Project solves it.

like image 167
Flamingo Avatar answered Oct 10 '22 11:10

Flamingo


Remove the CMakeCache.txt and try again. You probably had a bad cmake setup.

like image 38
amirkavyan Avatar answered Oct 10 '22 10:10

amirkavyan