# Problem with too long dependency file path (.d)

**URL:** https://discourse.cmake.org/t/problem-with-too-long-dependency-file-path-d/7744
**Category:** Usage
**Tags:** os:windows, gen:ninja
**Created:** [March 22, 2023, 6:50am UTC](https://discourse.cmake.org/t/problem-with-too-long-dependency-file-path-d/7744 "2023-03-22T06:50:31Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Pahlden](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/p/919ad9/32.png) [@Pahlden](https://discourse.cmake.org/u/Pahlden)
#### Post date: [March 22, 2023, 6:50am UTC](https://discourse.cmake.org/t/problem-with-too-long-dependency-file-path-d/7744/1 "2023-03-22T06:50:31Z")

</div>

I’m running in a problem with dependency file path which seem to be too long for CMAKE:

example: _[4/1995] Building CXX object x\_service\_server\_ServiceRplOnline…neChangeReq\_eGetActivePouTypeChangeListReq\_SkelDesFac\_.cpp.obj_

_FAILED: x\_service\_server\_ServiceRplOnlineChange.pro/CMakeFiles/x\_service\_server\_ServiceRplOnlineChange.pro.dir/aa5c030395ffb07dc8b198181308a9b1/SvcRplOnlineChangeReq\_eGetActivePouTypeChangeListReq\_SkelDesFac\_.cpp.obj_

_C:\PROGRA~2\GNU\_TO~1\8\_2019~1\bin\AR10B2~1.EXE -DARM\_CYCLONVSOC -DHW\_CHANNEL\_ID\_A -DOS\_CFG\_ICC\_ENABLE=1 -DOS\_CFG\_MICROC -DRUN\_FROM\_RAM -DSSP\_RUNTIME\_FS -DTARGET\_DEVICE\_G1 -DTARGET\_DEVICE\_G1\_CPU2 -D\_DEBUG -Dsoc\_cv\_av -IL:/platform/system\_framework/X\_SFW\_DeviceManager/build/target/Batch -IL:/platform/pilz\_os/build/target/libraries/armv7a/gcc\_header/armv7a-none-eabi/include/c++/8.3.1/backward -IL:/platform/pilz\_os/build/target/libraries/armv7a/gcc\_header/armv7a-none-eabi/include/c++/8.3.1/arm-none-eabi -IL:/platform/pilz\_os/build/target/libraries/armv7a/gcc\_header/armv7a-none-eabi/include/c++/8.3.1 -IL:/platform/pilz\_os/build/target/libraries/armv7a/gcc\_header/lib/gcc/armv7a-none-eabi/8.3.1/include -IL:/platform/pilz\_os/build/target/libraries/armv7a/gcc\_header/lib/gcc/armv7a-none-eabi/8.3.1/include-fixed -IL:/platform/pilz\_os/build/target/libraries/armv7a/gcc\_header/armv7a-none-eabi/inconfig -IL:/platform/safetynet/build/default\_config -IL:/platform/safetynet/src/snet -march=armv7-a -mtune=cortex-a9 -mfloat-abi=hard -mfpu=neon -ffreestanding -fno-short-enums -nostdinc -g -O2 -fno-strict-aliasing -std=gnu++11 --specs=nosys.specs -MD -MT x\_service\_server\_ServiceRplOnlineChange.pro/CMakeFiles/x\_service\_server\_ServiceRplOnlineChange.pro.dir/aa5c030395ffb07dc8b198181308a9b1/SvcRplOnlineChangeReq\_eGetActivePouTypeChangeListReq\_SkelDesFac\_.cpp.obj -MF x\_service\_server\_ServiceRplOnlineChange.pro\CMakeFiles\x\_service\_server\_ServiceRplOnlineChange.pro.dir\aa5c030395ffb07dc8b198181308a9b1\SvcRplOnlineChangeReq\_eGetActivePouTypeChangeListReq\_SkelDesFac\_.cpp.obj.d -o x\_service\_server\_ServiceRplOnlineChange.pro/CMakeFiles/x\_service\_server\_ServiceRplOnlineChange.pro.dir/aa5c030395ffb07dc8b198181308a9b1/SvcRplOnlineChangeReq\_eGetActivePouTypeChangeListReq\_SkelDesFac\_.cpp.obj -c L:/platform/services/rplonlinechange/ServiceRplOnlineChange/src/SvcRplOnlineChangeReq\_eGetActivePouTypeChangeListReq\_SkelDesFac\_.cpp_

_L:/platform/services/rplonlinechange/ServiceRplOnlineChange/src/SvcRplOnlineChangeReq\_eGetActivePouTypeChangeListReq\_SkelDesFac\_.cpp:16:1: fatal error: opening dependency file x\_service\_server\_ServiceRplOnlineChange.pro\CMakeFiles\x\_service\_server\_ServiceRplOnlineChange.pro.dir\aa5c030395ffb07dc8b198181308a9b1\SvcRplOnlineChangeReq\_eGetActivePouTypeChangeListReq\_SkelDesFac\_.cpp.obj.d: No such file or directory_

Increasing the value of variable “CMAKE\_OBJECT\_PATH\_MAX” and enabling Windows long paths does not solve the problem.

Unfortunately, I have no simple way to reduce the directory structure created by CMAKE.

Is there any way of solving that problem?

---

<div class="post-metadata">

### Author: ![mrmsdbdl](https://discourse.cmake.org/user_avatar/discourse.cmake.org/mrmsdbdl/32/2686_2.png) [@mrmsdbdl](https://discourse.cmake.org/u/mrmsdbdl)
#### Post date: [March 22, 2023, 9:08am UTC](https://discourse.cmake.org/t/problem-with-too-long-dependency-file-path-d/7744/2 "2023-03-22T09:08:27Z")

</div>

This is a known problem, and really annoying to deal with. If you know that the project supports Windows, then developers might have already _tried_ to account for it; but most likely they are at their limit. So, what you wanna do is to start with the shortest path possible, ie. `L:/b` and hope that it works.

If I’m right Windows Terminal plays nicer with this, so, if you haven’t tried this, maybe try using Windows Terminal after enabling Windows Long Paths. It might help as well.

---

<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: [March 22, 2023, 12:27pm UTC](https://discourse.cmake.org/t/problem-with-too-long-dependency-file-path-d/7744/3 "2023-03-22T12:27:06Z")

</div>

> [@Pahlden](#):
>
> L:/platform/services/rplonlinechange/ServiceRplOnlineChange/src/SvcRplOnlineChangeReq\_eGetActivePouTypeChangeListReq\_SkelDesFac\_.cpp:16:1: fatal error: opening dependency file x\_service\_server\_ServiceRplOnlineChange.pro\CMakeFiles\x\_service\_server\_ServiceRplOnlineChange.pro.dir\aa5c030395ffb07dc8b198181308a9b1\SvcRplOnlineChangeReq\_eGetActivePouTypeChangeListReq\_SkelDesFac\_.cpp.obj.d: No such file or directory

Whatever tool outputs this needs to learn about long path syntax (`\\?\L:\…`). Maybe there’s a way to tell CMake that the build directory starts with `\\?\` (`-B` perhaps?) to cause it to generate such paths automatically?
