Wrongly computed PCH header dir
See original GitHub issueFor directory structure
PROJECT_DIR/
src/
stdafx.cxx
stdafx.h
and project file importing those properties
<ItemGroup>
<ClCompile Include="src\stdafx.cxx">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="src\*.cpp" />
<ClCompile Include="src\*.c">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClInclude Include="src\*.hpp" />
<ClInclude Include="src\*.h" />
</ItemGroup>
running Tidy Code
with Clang Power Tool 2.5.1
and VS2017
outputs
VERBOSE: PCH cpp name: src\stdafx.cxx
VERBOSE: PCH header name: stdafx.h
Join-Path : Cannot find path 'Disc:\...\PROJECT_DIR\stdafx.h' because it does not exist.
At C:\Users\...\VisualStudio\15.0_7afaccbd\Extensions\4zo3oigp.tpb\clang-build.ps1:524 char:25
+ ... ]] $paths = Join-Path -Path "$base" -ChildPath "$child" -Resolve -Err ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Disc:\...\PROJECT_DIR\stdafx.h:String) [Join-Path], ItemNotFoundExce
ption
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.JoinPathCommand
which is wrong because file is at ‘Disc:.…\PROJECT_DIR\src\stdafx.h’
Any workarounds? <PrecompiledHeaderFile>
property doesn’t accept path, only filename
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
How do I fix unexpected end of file error with pch.h
One option, if you are new to c++, is to just turn off pre-compiled headers in the project settings.
Read more >Cannot include pre-compiled header in a different folder
Choose a pre-compiled header. 2. Make a folder and make a source file inside there. 3. Try to either: 1) #include "pch.h ...
Read more >Faster builds with PCH suggestions from C++ Build Insights
A guide to using vcperf and the C++ Build Insights SDK for creating and optimizing precompiled headers for your C++ builds.
Read more >Precompiled Header (PCH) issues and recommendations
Precompiled headers work great as a “set it and forget it” feature. They rarely need attention when upgrading compilers, for example. However, ...
Read more >Incorrect path for precompiled headers in ` ...
Describe the bug The -include path for precompiled headers in compile_commands.json file does not include parent directories.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hello,
We’ve investigated your latest sample project and found that there are issues when project source files / headers are specified in property sheets. At the moment our project data loader is unable to load them from propsheets. We are working on a project data loader fix regarding this.
We’ll inform you when the fix will be pushed. Stay posted.
Regards, Gabriel
Scenario which fails: All projects have the same directories structure
so in a project file they import mentioned before properties
from a common properties sheet with an entry like
<Import Project="common.props" />
And to that point fix to the script works.Now, lets say some project has its own unique, internal library in its sources, so this project’s structure looks like
so it also needs additional include entries in its project file after imported common includes. Like that
And in such case script fails.
sample project.zip