# The system cannot find the file specified

**URL:** https://discourse.cmake.org/t/the-system-cannot-find-the-file-specified/8987
**Category:** Development
**Created:** [September 15, 2023, 5:44pm UTC](https://discourse.cmake.org/t/the-system-cannot-find-the-file-specified/8987 "2023-09-15T17:44:44Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Aldrina\_Bernard](https://discourse.cmake.org/user_avatar/discourse.cmake.org/aldrina_bernard/32/3834_2.png) [@Aldrina\_Bernard](https://discourse.cmake.org/u/Aldrina_Bernard)
#### Post date: [September 15, 2023, 5:44pm UTC](https://discourse.cmake.org/t/the-system-cannot-find-the-file-specified/8987/1 "2023-09-15T17:44:44Z")

</div>

Hi All, I am trying to build a CMakeLists.txt file. I followed the below steps

1. Created tasks.json and added the git bash commands
2. Created the CMakeLists.txt file.
3. Created the settings,json file and added the cmake.sourceDirectory  
 ![image](https://discourse.cmake.org/uploads/default/original/2X/9/99cce05845b6a04e6e729c0a51c86f1be3f1579d.png)  
Note : Operating sytstem is windows 11.

---

<div class="post-metadata">

### Author: ![scivision](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/s/a87d85/32.png) [@scivision](https://discourse.cmake.org/u/scivision)
#### Post date: [September 15, 2023, 7:27pm UTC](https://discourse.cmake.org/t/the-system-cannot-find-the-file-specified/8987/2 "2023-09-15T19:27:04Z")

</div>

It looks like you’re cross-compiling, which has extra requirements in general. Maybe the project you’re trying to build has a forum specific for their project?

---

<div class="post-metadata">

### Author: ![Aldrina\_Bernard](https://discourse.cmake.org/user_avatar/discourse.cmake.org/aldrina_bernard/32/3834_2.png) [@Aldrina\_Bernard](https://discourse.cmake.org/u/Aldrina_Bernard)
#### Post date: [September 16, 2023, 4:54am UTC](https://discourse.cmake.org/t/the-system-cannot-find-the-file-specified/8987/3 "2023-09-16T04:54:23Z")

</div>

Hi ,  
I resolved that error. I am getting an error saying the elf file is not getting generated because it is not able to identify the sources to the target. Attaching the screenshot for reference.

 ![image](https://discourse.cmake.org/uploads/default/original/2X/d/d3b9bf664205e6d6d2061ec8be8fa1dd1836fd35.png)

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [September 16, 2023, 12:11pm UTC](https://discourse.cmake.org/t/the-system-cannot-find-the-file-specified/8987/4 "2023-09-16T12:11:34Z")

</div>

It looks like you have an `add_executable(Mimosa.elf)` but are not telling CMake what sources should be compiled into that executable. I recommend going through [the tutorial](https://cmake.org/cmake/help/latest/guide/tutorial/index.html) to learn more about CMake and how it works here.

Also, please share text in the future, not screenshots.

---

<div class="post-metadata">

### Author: ![Aldrina\_Bernard](https://discourse.cmake.org/user_avatar/discourse.cmake.org/aldrina_bernard/32/3834_2.png) [@Aldrina\_Bernard](https://discourse.cmake.org/u/Aldrina_Bernard)
#### Post date: [September 19, 2023, 11:09am UTC](https://discourse.cmake.org/t/the-system-cannot-find-the-file-specified/8987/5 "2023-09-19T11:09:43Z")

</div>

Hi Ben, Thanks for the tutorial recommendation. I read the tutorial . I am not able to figure out why it is taking a different toolchain path. In the task,json file I am giving a path in c/workspace/GNU\_Arm\_Embedded\_Toolchain/10\_2021.10/bin.  
Attaching the error I am facing.

Executing task in folder Draco: WorkDir=“/c/workspace/research/MC\_Mimosa/Draco/source”;export PATH=$PATH:/c/workspace/CMake/bin:/c/workspace/GNU\_Arm\_Embedded\_Toolchain/10\_2021.10/bin;cmake -G"MinGW Makefiles" -B ${WorkDir}/\_build/Debug -S ${WorkDir} -DCMAKE\_BUILD\_TYPE=Debug -DCMAKE\_MAKE\_PROGRAM=make;cmake --build ${WorkDir}/\_build/Debug -j8

– The C compiler identification is GNU 10.3.1  
– The CXX compiler identification is GNU 10.3.1  
– Detecting C compiler ABI info  
– Detecting C compiler ABI info - failed  
– Check for working C compiler: C:/Program Files (x86)/GNU Arm Embedded Toolchain/10 2021.10/bin/arm-none-eabi-gcc.exe  
– Check for working C compiler: C:/Program Files (x86)/GNU Arm Embedded Toolchain/10 2021.10/bin/arm-none-eabi-gcc.exe - broken  
CMake Error at C:/Program Files/CMake/share/cmake-3.27/Modules/CMakeTestCCompiler.cmake:67 (message):  
The C compiler

```
"C:/Program Files (x86)/GNU Arm Embedded Toolchain/10 2021.10/bin/arm-none-eabi-gcc.exe"

```

is not able to compile a simple test program.

It fails with the following output:

```
Change Dir: 'C:/workspace/research/MC_Mimosa/Draco/source/_build/Debug/CMakeFiles/CMakeScratch/TryCompile-1md2ay'

Run Build Command(s): "C:/Program Files/CMake/bin/cmake.exe" -E env VERBOSE=1 make -f Makefile cmTC_87577/fast
The system cannot find the file specified

```

CMake will not be able to correctly generate this project.  
Call Stack (most recent call first):  
CMakeLists.txt:20 (project)

– Configuring incomplete, errors occurred!  
The system cannot find the file specified  
CMake Error: Generator: execution of make failed. Make command was: make -f Makefile -j8

- The terminal process “C:\Program Files\Git\bin\bash.exe ‘–login’, ‘-i’, ‘-c’, 'WorkDir=”/c/workspace/research/MC\_Mimosa/Draco/source";export PATH=$PATH:/c/workspace/CMake/bin:/c/workspace/GNU\_Arm\_Embedded\_Toolchain/10\_2021.10/bin;cmake -G"MinGW Makefiles" -B ${WorkDir}/\_build/Debug -S ${WorkDir} -DCMAKE\_BUILD\_TYPE=Debug -DCMAKE\_MAKE\_PROGRAM=make;cmake --build ${WorkDir}/\_build/Debug -j8’" terminated with exit code: 1.
- Terminal will be reused by tasks, press any key to close it.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [October 12, 2023, 12:41pm UTC](https://discourse.cmake.org/t/the-system-cannot-find-the-file-specified/8987/6 "2023-10-12T12:41:52Z")

</div>

I think knowing what file cannot be found would be the next step. [Process Monitor](https://docs.microsoft.com/en-us/sysinternals/downloads/procmon) can be used to watch for errors and see what path(s) are being attempted.
