# GCC picks up wrong version of the C compiler (MySQL server)

**URL:** https://discourse.cmake.org/t/gcc-picks-up-wrong-version-of-the-c-compiler-mysql-server/14193
**Category:** Usage
**Created:** [June 3, 2025, 2:00pm UTC](https://discourse.cmake.org/t/gcc-picks-up-wrong-version-of-the-c-compiler-mysql-server/14193 "2025-06-03T14:00:28Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Yan\_Titarenko](https://discourse.cmake.org/user_avatar/discourse.cmake.org/yan_titarenko/32/5577_2.png) [@Yan\_Titarenko](https://discourse.cmake.org/u/Yan_Titarenko)
#### Post date: [June 3, 2025, 2:00pm UTC](https://discourse.cmake.org/t/gcc-picks-up-wrong-version-of-the-c-compiler-mysql-server/14193/1 "2025-06-03T14:00:28Z")

</div>

Hi there.  
I was compiling MySQL server sources on OpenSUSE Leap 15.6. I was specifying compilers like this:

> cmake -DCMAKE\_CXX\_COMPILER=g+±16 \_DCMAKE\_C\_COMPILER=gcc-16 -DWITH\_SYSTEM\_LIBS=TRUE ..

Here is what I get:

> – Running cmake version 3.28.3  
> – Found Git: /usr/bin/git (found version “2.43.0”)  
> – CMAKE\_MODULE\_PATH is /home/yantitarenko5/mysql-server/cmake  
> – MySQL 9.3.0  
> – The C compiler identification is GNU 7.5.0  
> – The CXX compiler identification is GNU 16.0.0  
> – Detecting C compiler ABI info  
> – Detecting C compiler ABI info - done  
> – Check for working C compiler: /usr/bin/cc - skipped  
> – Detecting C compile features  
> – Detecting C compile features - done  
> – Detecting CXX compiler ABI info  
> – Detecting CXX compiler ABI info - done  
> – Check for working CXX compiler: /usr/bin/g+±16 - skipped  
> – Detecting CXX compile features  
> – Detecting CXX compile features - done

Please help

---

<div class="post-metadata">

### Author: ![Angew](https://discourse.cmake.org/user_avatar/discourse.cmake.org/angew/32/229_2.png) [@Angew](https://discourse.cmake.org/u/Angew)
#### Post date: [June 3, 2025, 2:06pm UTC](https://discourse.cmake.org/t/gcc-picks-up-wrong-version-of-the-c-compiler-mysql-server/14193/2 "2025-06-03T14:06:30Z")

</div>

There’s a typo in your command line. You have an underscore in `_DCMAKE_C_COMPILER` instead of the expected dash `-DCMAKE_C_COMPILER`

---

<div class="post-metadata">

### Author: ![Yan\_Titarenko](https://discourse.cmake.org/user_avatar/discourse.cmake.org/yan_titarenko/32/5577_2.png) [@Yan\_Titarenko](https://discourse.cmake.org/u/Yan_Titarenko)
#### Post date: [June 3, 2025, 2:29pm UTC](https://discourse.cmake.org/t/gcc-picks-up-wrong-version-of-the-c-compiler-mysql-server/14193/3 "2025-06-03T14:29:03Z")

</div>

Thanks. You can close this.
