The system cannot find the file specified

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

    Note : Operating sytstem is windows 11.

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?

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.

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 to learn more about CMake and how it works here.

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

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.

I think knowing what file cannot be found would be the next step. Process Monitor can be used to watch for errors and see what path(s) are being attempted.