# Compiler program installed in Windows cannot recognize file path generated by Cmake in Cygwin.

**URL:** https://discourse.cmake.org/t/compiler-program-installed-in-windows-cannot-recognize-file-path-generated-by-cmake-in-cygwin/8369
**Category:** Usage
**Tags:** os:windows, gen:ninja
**Created:** [June 21, 2023, 8:24am UTC](https://discourse.cmake.org/t/compiler-program-installed-in-windows-cannot-recognize-file-path-generated-by-cmake-in-cygwin/8369 "2023-06-21T08:24:45Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![focusfeel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/f/57b2e6/32.png) [@focusfeel](https://discourse.cmake.org/u/focusfeel)
#### Post date: [June 21, 2023, 8:24am UTC](https://discourse.cmake.org/t/compiler-program-installed-in-windows-cannot-recognize-file-path-generated-by-cmake-in-cygwin/8369/1 "2023-06-21T08:24:45Z")

</div>

Environment description:

- Cmake and Ninja installed in Cygwin
- Compiler program (like mingw-gcc) installed in Windows

When I use cmake in cygwin to build a project, it will go error when running try-compile project for detecting compiler ABI info and features. The error log says the compiler cannot open source file.

I found it is caused by the source file path format. As camke is installed in cygwin, when build a project, it will generate files with path in cygwin format (like /cygdrive/e/home/user/path/to/project), but the compiler is installed in Windows, it can only recognize file path in Windows format (like E:/home/user/path/to/project).

Is there any methods to fix this error?

---

<div class="post-metadata">

### Author: ![hsattler](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/h/59ef9b/32.png) [@hsattler](https://discourse.cmake.org/u/hsattler)
#### Post date: [June 21, 2023, 10:59am UTC](https://discourse.cmake.org/t/compiler-program-installed-in-windows-cannot-recognize-file-path-generated-by-cmake-in-cygwin/8369/2 "2023-06-21T10:59:57Z")

</div>

You cannot mix cygwin and non-cygwin programs if file paths are involved. Choose one or the other.

---

<div class="post-metadata">

### Author: ![David\_Dyck](https://discourse.cmake.org/user_avatar/discourse.cmake.org/david_dyck/32/5289_2.png) [@David\_Dyck](https://discourse.cmake.org/u/David_Dyck)
#### Post date: [February 28, 2025, 5:53pm UTC](https://discourse.cmake.org/t/compiler-program-installed-in-windows-cannot-recognize-file-path-generated-by-cmake-in-cygwin/8369/4 "2025-02-28T17:53:18Z")

</div>

We have been able to use cygwin with the ARM mingw base compilers  
there have been issues with cmake not using the the @ response files (there are workarounds for that) and some path work to allow /cydrive/c and /c to work transparently. (e.g. in cygwin bash, mkdir -p /cygdrive/c/cygdrive/c and create native symlinks or junctions in that directory to where the files really are )

also some work must be done to clean up the dependency paths generated from the mingw compilers

( just noticed you were using ninja, and we are using unix makefiles, but I think some of this may apply )
