# How to compile cmake with custom installed GCC

**URL:** https://discourse.cmake.org/t/how-to-compile-cmake-with-custom-installed-gcc/11699
**Category:** Usage
**Tags:** os:linux
**Created:** [September 16, 2024, 5:14pm UTC](https://discourse.cmake.org/t/how-to-compile-cmake-with-custom-installed-gcc/11699 "2024-09-16T17:14:55Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![joeyskeys](https://discourse.cmake.org/user_avatar/discourse.cmake.org/joeyskeys/32/4943_2.png) [@joeyskeys](https://discourse.cmake.org/u/joeyskeys)
#### Post date: [September 16, 2024, 5:14pm UTC](https://discourse.cmake.org/t/how-to-compile-cmake-with-custom-installed-gcc/11699/1 "2024-09-16T17:14:55Z")

</div>

The problem I encountered is that during the build, some system include conflicts with the system headers and the compiler complains redefinition of enum like fsconfig\_command.  
I tried to set -nostdinc into CXXFLAGS and it caused the build failed at the bootstrap step, and the output says cannot find an c++ compiler but I can confirm that the CXX environment variable is set.  
Can anyone tell me what to do?
