# gcc15 and cmake 4.0.1: errors at cross-building cmake

**URL:** https://discourse.cmake.org/t/gcc15-and-cmake-4-0-1-errors-at-cross-building-cmake/14048
**Category:** Code
**Tags:** os:linux, gen:ninja
**Created:** [May 5, 2025, 3:04pm UTC](https://discourse.cmake.org/t/gcc15-and-cmake-4-0-1-errors-at-cross-building-cmake/14048 "2025-05-05T15:04:39Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Piotr\_Oniszczuk](https://discourse.cmake.org/user_avatar/discourse.cmake.org/piotr_oniszczuk/32/5548_2.png) [@Piotr\_Oniszczuk](https://discourse.cmake.org/u/Piotr_Oniszczuk)
#### Post date: [May 5, 2025, 3:04pm UTC](https://discourse.cmake.org/t/gcc15-and-cmake-4-0-1-errors-at-cross-building-cmake/14048/1 "2025-05-05T15:04:39Z")

</div>

Hi guys,  
I’m in upgrade process of gcc from 14.2.0 to 15.1.0 in my distros and have issue with cross-compiling cmake 4.0.1 for my toolchain.

Cross-build erorr is like this: [gist:d171eaf91b52dd999a2cf9019342d558 · GitHub](https://gist.github.com/warpme/d171eaf91b52dd999a2cf9019342d558)

I’m not sure is it: gcc15 bug or cmake 4.0.1 incompability with gcc15?

Can somebody hint me how to move froward with this issue?

---

<div class="post-metadata">

### Author: ![Piotr\_Oniszczuk](https://discourse.cmake.org/user_avatar/discourse.cmake.org/piotr_oniszczuk/32/5548_2.png) [@Piotr\_Oniszczuk](https://discourse.cmake.org/u/Piotr_Oniszczuk)
#### Post date: [May 7, 2025, 10:10am UTC](https://discourse.cmake.org/t/gcc15-and-cmake-4-0-1-errors-at-cross-building-cmake/14048/2 "2025-05-07T10:10:18Z")

</div>

upgrade to 4.0.2 not helps ☹  
Error is still like this: [gist:928e4e1fef5e4de68e9dcf17d6d53b8c · GitHub](https://gist.github.com/warpme/928e4e1fef5e4de68e9dcf17d6d53b8c)

---

<div class="post-metadata">

### Author: ![jtxa](https://discourse.cmake.org/user_avatar/discourse.cmake.org/jtxa/32/1535_2.png) [@jtxa](https://discourse.cmake.org/u/jtxa)
#### Post date: [May 7, 2025, 6:05pm UTC](https://discourse.cmake.org/t/gcc15-and-cmake-4-0-1-errors-at-cross-building-cmake/14048/3 "2025-05-07T18:05:27Z")

</div>

Are you updating CMake and GCC at the same time? Why not do it sequentially.

The error does not seem to be related to CMake.  
According to your error message `bool` is the same as `unsigned char`. In C++ they are specified as distinct types. This usually only happens, if some C programmer creates such a define.

Try to compile a C++ file with just this:

```C++
#include <string>

```

If that fails, something with your cross compiler is wrong.

But if that works, you need to find out why if fails. I would compile `cmCursesDummyWidget.cxx` manually, and iteratively strip everything before the `<string>` include until you identify which code before causes that message. Everything after the include can be immediately removed, as they don’t cause the problem.

---

<div class="post-metadata">

### Author: ![Piotr\_Oniszczuk](https://discourse.cmake.org/user_avatar/discourse.cmake.org/piotr_oniszczuk/32/5548_2.png) [@Piotr\_Oniszczuk](https://discourse.cmake.org/u/Piotr_Oniszczuk)
#### Post date: [May 13, 2025, 11:08am UTC](https://discourse.cmake.org/t/gcc15-and-cmake-4-0-1-errors-at-cross-building-cmake/14048/4 "2025-05-13T11:08:13Z")

</div>

Josef,  
Many thx for replay. I managed to get cmake cross-cmpiling.  
Issue was too old ncurses in my distro: i had 6.4; upgrade to 6.5\_20250503 fixes issue.  
I think it is bug in cmake deps checking - as current 4.0.2 allows to build attempt we know build will be failing due too old dependency.

(interesting is that too old ncurses issue was only manifesting for cmake.  
other huge components like qt5 (+5k objects to build or chrominium with +24k objects to build - all were cross-building no problem)

sad that i lost 4 days trying to solve this…

---

<div class="post-metadata">

### Author: ![jtxa](https://discourse.cmake.org/user_avatar/discourse.cmake.org/jtxa/32/1535_2.png) [@jtxa](https://discourse.cmake.org/u/jtxa)
#### Post date: [May 13, 2025, 6:52pm UTC](https://discourse.cmake.org/t/gcc15-and-cmake-4-0-1-errors-at-cross-building-cmake/14048/5 "2025-05-13T18:52:19Z")

</div>

My Debian stable has curses v6.4 installed.  
CMake compiles (gcc 12) without problems and `ccmake` works in the terminal.
