ReSharper C++ is not aware of the header files of my project

I am working on a header only library findMFBase (https://github.com/findMF/findMFBase). This library is shipped with unit tests which produce exe's. As metabuild system I am using cmake. I generate the sln and vcprojs using: cmake ..\findMFBase -G "Visual Studio 12 2013 Win64".

The problem is that C++ ReSharper seems not to be aware of any of the header files of findMFBase project.

As long as I am in the .cpp file everything is fine but if I open an header of my project than the #include statements pointing to other header files within the findMFBase library are marked in red.

I did the cmake glob 'trick' to have the header files included in the projects.

 
file(GLOB Demo_HEADERS "sql/*.sql" "include/*.h" "include/**/*.h" "include/**/**/*.h"
 
 "include/**/**/**/*.h" "src/**/*.h" "src/**/**/*.h" ".travis.yml")
 
add_library(headers SHARED ${Demo_HEADERS} Dummy.cpp)



How can I make ReSharper C++ aware of this files?

 

resgards
Witold

4 comments

Hello Witold!
Thank you for contacting us.
Please try to install latest ReSharper Release (https://www.jetbrains.com/resharper-cpp/download/), clear cash (ReSharper ->Options -> General -> Clear Caches) and try to reproduce your problem again.
Thank you!

1

It seems improved. Most of the includes are not anymore highlighted as missing.
However, for instance  in file deisotoper.h line 28 #include <base/chemistry/iisotopeenvelope.h> is marked with an error (cannot open source file). However, compiler has not problem building the project.

Furthermore, some warnings about possible unused #include directives are missleading. For instance in filter.h
#include <boost/cstdint.hpp> on line 14 is marked as unused while on line 32  typedef boost::uint32_t uint32_t; is clearly used.


These are just 2 examples, I found going through the solution after updateing ReSharper C++. But there are much more of these types of problems : i.e. file readtableutils.h
where presumably <boost/lexical_cast.hpp> file does not exist.
To many instances where  a header is marked as unused i.e. <string> and just a few lines below there is a function declaration where one of the arguments is of the type std::string.
(readtable.h)


ReSharper C++ is not perfect. But worse I am bit worried that using it might introduce errors which werent there (for instance if I start removing header includes as suggested).



regards

0

Hello Witold!
Thank you for your answer!
I've created an issue in YouTrack: https://youtrack.jetbrains.com/issue/RSCPP-15370
You can follow this request and vote for it.
Thank you!

0

Witold, thanks for the feedback!

Looks like deisotoper.h is not included into any .cpp in your solution, so in fact it does not get compiled. The error is valid - if you try to include deisotoper.h say into dummy.cpp, the compiler would report the same error. The same goes for your other example with readtableutils.h.

'Possibly unused #include' issue in filter.h is unfortunately a bug, it is tracked in https://youtrack.jetbrains.com/issue/RSCPP-12757. As a workaround, if this analysis breaks your code too often, you can disable it until the issue is fixed.

0

Please sign in to leave a comment.