# CMake Error at CMakeLists.txt:7 (project)

**URL:** <https://swi-prolog.discourse.group/t/cmake-error-at-cmakelists-txt-7-project/9394>\
**Category:** Installing\
**Created:** [November 19, 2025, 9:56pm UTC](https://swi-prolog.discourse.group/t/cmake-error-at-cmakelists-txt-7-project/9394 "2025-11-19T21:56:16Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![BenEngbers](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/benengbers/32/95_2.png) [@BenEngbers](https://swi-prolog.discourse.group/u/BenEngbers)\
**Post date:** [November 19, 2025, 9:56pm UTC](https://swi-prolog.discourse.group/t/cmake-error-at-cmakelists-txt-7-project/9394/1 "2025-11-19T21:56:16Z")

</div>

Last year I have been very busy with other activities, hence I didn’t have much time to continue with my Prolog/C++ project. Hopefully the next future will be more quiet so I can pickup programmig again.

I recently bought a new laptop, installed Fedora 43 and after installing all the prerequisites I am trying to install the lates version of SWIPL. I followed these instructions: [https://www.swi-prolog.org/build/unix.html](https://www.swi-prolog.org/build/unix.html) . But the command cmake -DCMAKE\_INSTALL\_PREFIX=$HOME -DCMAKE\_BUILD\_TYPE=PGO -G Ninja .. results in an error, complaining that it cannot find a c++ compiler.

is this a known problem? And how can I fix this (which file should be edited)?

---

<div class="post-metadata">

**Author:** ![Boris](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/boris/32/7486_2.png) [@Boris](https://swi-prolog.discourse.group/u/Boris)\
**Post date:** [November 20, 2025, 4:13am UTC](https://swi-prolog.discourse.group/t/cmake-error-at-cmakelists-txt-7-project/9394/2 "2025-11-20T04:13:00Z")

</div>

Are you sure you have installed a C++ compiler?

---

<div class="post-metadata">

**Author:** ![BenEngbers](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/benengbers/32/95_2.png) [@BenEngbers](https://swi-prolog.discourse.group/u/BenEngbers)\
**Post date:** [November 20, 2025, 10:22am UTC](https://swi-prolog.discourse.group/t/cmake-error-at-cmakelists-txt-7-project/9394/3 "2025-11-20T10:22:08Z")

</div>

To my knowlwedge C and C++ have always default been installed in Fedora.

> gcc –version returns gcc (GCC) 15.2.1 20251111 (Red Hat 15.2.1-4)

---

<div class="post-metadata">

**Author:** ![Boris](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/boris/32/7486_2.png) [@Boris](https://swi-prolog.discourse.group/u/Boris)\
**Post date:** [November 20, 2025, 10:36am UTC](https://swi-prolog.discourse.group/t/cmake-error-at-cmakelists-txt-7-project/9394/4 "2025-11-20T10:36:08Z")

</div>

How about

```prolog
$ g++ --version

```

??

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [November 20, 2025, 10:39am UTC](https://swi-prolog.discourse.group/t/cmake-error-at-cmakelists-txt-7-project/9394/5 "2025-11-20T10:39:31Z")

</div>

Just upgraded to Fedora 43 and I can confirm the system builds completely clean. Not being able to detect a C++ compiler is either a missing package or some other weird local problem. Nothing SWI-Prolog can do anything about.

---

<div class="post-metadata">

**Author:** ![BenEngbers](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/benengbers/32/95_2.png) [@BenEngbers](https://swi-prolog.discourse.group/u/BenEngbers)\
**Post date:** [November 20, 2025, 10:39am UTC](https://swi-prolog.discourse.group/t/cmake-error-at-cmakelists-txt-7-project/9394/6 "2025-11-20T10:39:56Z")

</div>

g++ (GCC) 15.2.1 20251111 (Red Hat 15.2.1-4)

---

<div class="post-metadata">

**Author:** ![BenEngbers](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/benengbers/32/95_2.png) [@BenEngbers](https://swi-prolog.discourse.group/u/BenEngbers)\
**Post date:** [November 20, 2025, 10:43am UTC](https://swi-prolog.discourse.group/t/cmake-error-at-cmakelists-txt-7-project/9394/7 "2025-11-20T10:43:41Z")

</div>

The new laptop has a clean install from Fedora 43. My old laptop has an upgrade form 42 → 43.

I’ll try to upgrade swipl on that machine also and see what happens there.

EDIT

I added SDL3-devel package, pulled the new code, updated submodules, cd’d into build and entered the cmake command. On the old machine this command executes!

ninja aborts, complaining that it can not find java-21-openjdk-21.0.3.0.9-1

I’ll try to change that into java-latest-openjdk

Maybe the problems on the new machine are caused by new CMake?

EDIT 2

On the old laptop I renamed swipl-devel to swipl-devel\_bak. Then I edited .bashrc to enter Java environment variables for JAVA\_HOME and LD\_LIBRARY\_PATH.

After cloning swipl I started the compile/build procedure which executed without problems. If I have enough time, I’ll do the same on myn new laptop.

EDIT 3

After creating the environment variables for Java on the new machine, I tried again to execute the cmake command. This command reproduced the same error:

> – The C compiler identification is unknown  
> – The CXX compiler identification is unknown  
> CMake Error at CMakeLists.txt:7 (project):  
> The CMAKE\_C\_COMPILER:
> 
> ```prolog
> /usr/lib64/ccache/cc
> 
> ```
> 
> is not a full path to an existing compiler tool.

I renamed swipl-devel to swipl-devel.bak and create a new clone. This time there were no problems.

I checked CMakefiles.txt in both development branches and they are identical so I have no idea what causes the compiulation error.
