# "No such file or directory" error in CMake build using arm-none-eabi

**URL:** https://discourse.cmake.org/t/no-such-file-or-directory-error-in-cmake-build-using-arm-none-eabi/3533
**Category:** Usage
**Created:** [June 9, 2021, 2:06am UTC](https://discourse.cmake.org/t/no-such-file-or-directory-error-in-cmake-build-using-arm-none-eabi/3533 "2021-06-09T02:06:23Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![honestech](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/h/45deac/32.png) [@honestech](https://discourse.cmake.org/u/honestech)
#### Post date: [June 9, 2021, 2:06am UTC](https://discourse.cmake.org/t/no-such-file-or-directory-error-in-cmake-build-using-arm-none-eabi/3533/1 "2021-06-09T02:06:23Z")

</div>

Hi Everyone,

I am new here and trying to get my STM32WL55 project build using CMake.  
It’s my first trying to use CMake with STM32CubeMx and I have experienced it in ZephyrRTOS.  
After read many topics on google, I have written the CMakeLists.txt in my project then tried to build it.  
What I am getting now is the building error, it shows the object file path without ‘slash’ like this.

`arm-none-eabi-gcc.exe: error: CMakeFilesmyproject.elf.dirCoreSrcapp_freertos.c.obj: No such file or directory`  
It repeats every \*.obj file. ☹

I think the path should be like `CMakeFiles\myproject.elf.dir\Core\Src\app_freertos.c.obj`.  
But all of the object files exist in the right place.

Does anyone have any idea?

Thanks in advance.  
Pengxiang.

---

<div class="post-metadata">

### Author: ![honestech](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/h/45deac/32.png) [@honestech](https://discourse.cmake.org/u/honestech)
#### Post date: [June 9, 2021, 3:52am UTC](https://discourse.cmake.org/t/no-such-file-or-directory-error-in-cmake-build-using-arm-none-eabi/3533/2 "2021-06-09T03:52:57Z")

</div>

After changes lots of things in CMakeLists.txt, it was gone away.  
Not sure what is the reason.

Thanks.

---

<div class="post-metadata">

### Author: ![craig.scott](https://discourse.cmake.org/user_avatar/discourse.cmake.org/craig.scott/32/20_2.png) [@craig.scott](https://discourse.cmake.org/u/craig.scott)
#### Post date: [June 9, 2021, 10:41pm UTC](https://discourse.cmake.org/t/no-such-file-or-directory-error-in-cmake-build-using-arm-none-eabi/3533/3 "2021-06-09T22:41:43Z")

</div>

When specifying any path in a file read by CMake (e.g. CMakeLists.txt, any \*.cmake file), use forward slashes (/) in paths, not backslashes (). When CMake parses a string, it will treat a backslash as escaping the following character. Internally, CMake uses forward slashes for paths, even on Windows.

---

<div class="post-metadata">

### Author: ![honestech](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/h/45deac/32.png) [@honestech](https://discourse.cmake.org/u/honestech)
#### Post date: [June 10, 2021, 7:51pm UTC](https://discourse.cmake.org/t/no-such-file-or-directory-error-in-cmake-build-using-arm-none-eabi/3533/4 "2021-06-10T19:51:18Z")

</div>

Thanks @craig.scott

As I mentioned, I can get build now, but weird why didn’t get such errors before.  
Yes, I agreed with the slash(/), not backslash(). I guessed it might be backslash on Windows. It’s my fault 😉

It took me a couple of days to get building the assemble file(startup\_xxx.S for the STM32 MCU), okay now.

I could fix it `target_link_libraries` instead of `target_link_options`.

Thank you
