# The CXX compiler identification is unknown building cross compile for Arm processor

**URL:** https://discourse.cmake.org/t/the-cxx-compiler-identification-is-unknown-building-cross-compile-for-arm-processor/14109
**Category:** Usage
**Tags:** os:linux
**Created:** [May 16, 2025, 6:33pm UTC](https://discourse.cmake.org/t/the-cxx-compiler-identification-is-unknown-building-cross-compile-for-arm-processor/14109 "2025-05-16T18:33:25Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![mogu](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/m/f05b48/32.png) [@mogu](https://discourse.cmake.org/u/mogu)
#### Post date: [May 16, 2025, 6:33pm UTC](https://discourse.cmake.org/t/the-cxx-compiler-identification-is-unknown-building-cross-compile-for-arm-processor/14109/1 "2025-05-16T18:33:25Z")

</div>

Hi,  
I am trying to cross compile code for ARM processor on Linux.  
Downloaded GNU Arm toolchain from Arm and able to build a sample C , C++ code directly.

But when I am trying to cross compile for ARM using Cmake, running into error “The CXX compiler identification is unknown” and it fails building.

I created a toolchain cmake file with following information and calling on top of my CMakeLists.txt above project () with LANGUAGES set to C CXX.  
I also tried setting env variables “CC” and “C” to cross compiler executable path. But same error.

set(CMAKE\_SYSTEM\_NAME Linux)  
#set(CMAKE\_SYSTEM\_PROCESSOR arm)  
set(CMAKE\_SYSTEM\_PROCESSOR armv8-a)  
set(tools /arm-gnu-toolchain-14.2.rel1-x86\_64-aarch64-none-linux-gnu)  
set(CMAKE\_C\_COMPILER ${tools}/bin/aarch64-none-linux-gnu-gcc)  
set(CMAKE\_CXX\_COMPILER ${tools}/bin/aarch64-none-linux-gnu-g++)  
set(CMAKE\_CXX\_COMPILER\_ID GNU)  
set(CMAKE\_CXX\_COMPILER\_VERSION 14.2.1)  
message( STATUS “toolchain cmake processor:${CMAKE\_SYSTEM\_PROCESSOR}” )  
message( STATUS “toolchain C compiler:${CMAKE\_C\_COMPILER}” )  
message( STATUS “toolchain C++ compiler:${CMAKE\_CXX\_COMPILER}” )  
message( STATUS “toolchain C++ compilerID:${CMAKE\_CXX\_COMPILER\_ID}” )  
message( STATUS “toolchain C++ compiler version:${CMAKE\_CXX\_COMPILER\_VERSION}” )

**Output from build**

– Defaulting build type to Release  
– toolchain cmake processor:armv8-a  
– toolchain C compiler:/arm-gnu-toolchain-14.2.rel1-x86\_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-gcc  
– toolchain C++ compiler:/arm-gnu-toolchain-14.2.rel1-x86\_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-g++  
– toolchain C++ compilerID:GNU  
– toolchain C++ compiler version:14.2.1  
– The C compiler identification is unknown  
– The CXX compiler identification is unknown  
CMake Error at CMakeLists.txt:67 (project):  
The CMAKE\_C\_COMPILER:

```
/arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-gcc

```

is not a full path to an existing compiler tool.

Tell CMake where to find the compiler by setting either the environment  
variable “CC” or the CMake cache entry CMAKE\_C\_COMPILER to the full path to  
the compiler, or to the compiler name if it is in the PATH.

**Contents from CMakeError.log**  
Compiling the C compiler identification source file “CMakeCCompilerId.c” failed.  
Compiler: /arm-gnu-toolchain-14.2.rel1-x86\_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-gcc  
Build flags:  
Id flags:

The output was:  
No such file or directory

Compiling the C compiler identification source file “CMakeCCompilerId.c” failed.  
Compiler: /arm-gnu-toolchain-14.2.rel1-x86\_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-gcc  
Build flags:  
Id flags: -c

The output was:  
No such file or directory

Compiling the C compiler identification source file “CMakeCCompilerId.c” failed.  
Compiler: /arm-gnu-toolchain-14.2.rel1-x86\_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-gcc  
Build flags:  
Id flags: -Aa

The output was:  
No such file or directory

Compiling the C compiler identification source file “CMakeCCompilerId.c” failed.  
Compiler:/arm-gnu-toolchain-14.2.rel1-x86\_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-gcc  
Build flags:  
Id flags: -D\_\_CLASSIC\_C\_\_

The output was:  
No such file or directory

Checking whether the C compiler is IAR using “” did not match “IAR .+ Compiler”:  
Compiling the CXX compiler identification source file “CMakeCXXCompilerId.cpp” failed.  
Compiler: /arm-gnu-toolchain-14.2.rel1-x86\_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-g++  
Build flags:  
Id flags:

The output was:  
No such file or directory

Compiling the CXX compiler identification source file “CMakeCXXCompilerId.cpp” failed.  
Compiler: /arm-gnu-toolchain-14.2.rel1-x86\_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-g++  
Build flags:  
Id flags: -c

The output was:  
No such file or directory

Checking whether the CXX compiler is IAR using “” did not match “IAR .+ Compiler”:
