[Bug c++/107974] New: compiler can't find source file in path that is longer than 255 characters
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107974 Bug ID: 107974 Summary: compiler can't find source file in path that is longer than 255 characters Product: gcc Version: 12.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: cristian.adam at gmail dot com Target Milestone: --- Created attachment 54013 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54013&action=edit clang long path Given the following path "c:\Projects\C++\this is a rather long path for a path on windows where long paths are a problem with the limit of two hundred fifty characters but there is a solution which implies adding a registry key and configuring the project to include a manifest\hello.cpp" g++ (x86_64-posix-seh-rev1, Built by MinGW-W64 project) 12.2.0 is not able to compile the source file. The error reported is: cc1plus.exe: fatal error: hello.cpp: No such file or directory Note that LLVM MinGW 15.0.0's clang.exe was able to compile the file just fine.
[Bug c++/107974] compiler can't find source file in path that is longer than 255 characters
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107974 --- Comment #1 from Cristian Adam --- Visual C++ 2022 also suffers from the same problem, see https://developercommunity.visualstudio.com/t/compiler-cant-find-source-file-in-path/10221576 For some reason clang is working fine.
[Bug preprocessor/107974] compiler can't find source file in path that is longer than 255 characters
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107974 --- Comment #3 from Cristian Adam --- I've used the manifest tool from Visual C++ (mt.exe) to inject this manifest: http://schemas.microsoft.com/SMI/2016/WindowsSettings";> true with the command line: mt.exe -nologo -manifest "cc1plus.exe.manifest" -outputresource:"cc1plus.exe;#1" And I was able to compile the hello.cpp source file!
[Bug preprocessor/107974] compiler can't find source file in path that is longer than 255 characters
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107974 --- Comment #4 from Cristian Adam --- The manifest file is being mentioned at https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry
[Bug preprocessor/107974] compiler can't find source file in path that is longer than 255 characters
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107974 --- Comment #5 from Cristian Adam --- Created attachment 54016 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54016&action=edit gcc long path working