Include only headerfilename

In our project we have setup the build process to automatically generate the include paths for the build. So in our source files we just need to #include "Class.h".

I'm not aware of an option to change the behavior of #includes generated by R# to do the same, include the header without any path specification, just the filename.

Did I miss something or is this a new feature?



ReSharper should automatically come up with a shortest possible include path, which in your case should be just the filename. Is this not so in your case?


No, it will create a relative path which ends up being usually to a folder containing stubbed headers for tests (usually closer than the original components header file).

Our project uses a GNU makefile, I'm not sure if I set up everything right in Visual Studio or in Resharper to make them aware of our include structure.

We are adding the paths of the header files to the IntelliSense search path under the project NMake-options.



ReSharper should pick up paths from the IntelliSense search path option. If it's not too much trouble, could you please create a test solution which is close to your setup and has the same issue and attach it to a new request on Thanks!


As I was just writing code in a different part of our solution, Resharper actually created just the filename as include. So I've probably messed up something somewhere...

Maybe I can single out a reason why that happens and then I can try to recreate it in a smaller solution.


Please sign in to leave a comment.