You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This works well, with the exception that clangd raises warning:
If I remove the two headers below, then I get a compilation error:
/usr/bin/ld: CMakeFiles/bth.dir/bth.cpp.o: warning: relocation against `_ZTVN3CLI9FormatterE' in read-only section `.text._ZN3CLI9FormatterC2Ev[_ZN3CLI9FormatterC5Ev]'
/usr/bin/ld: CMakeFiles/bth.dir/bth.cpp.o: in function `CLI::ConfigBase::ConfigBase()':
/opt/CLI11/include/CLI/ConfigFwd.hpp:81: undefined reference to `vtable for CLI::ConfigBase'
/usr/bin/ld: CMakeFiles/bth.dir/bth.cpp.o: in function `CLI::Formatter::Formatter()':
/opt/CLI11/include/CLI/FormatterFwd.hpp:120: undefined reference to `vtable for CLI::Formatter'
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE
collect2: error: ld returned 1 exit status
Added include-what-you-use pragmas to:
* let IWYU point users to the main include file CLI/CLI.hpp
* tell IWYU that CLI/CLI.hpp is the main exporting header.
This should fix#816
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Philip Top <phlptp@gmail.com>
In the README, it is recommended to include the following three headers in your application:
#include "CLI/App.hpp"
#include "CLI/Formatter.hpp"
#include "CLI/Config.hpp"
This works well, with the exception that clangd raises warning:
If I remove the two headers below, then I get a compilation error:
It would be nice if the warnings raised by clangd were suppressed via IWYU pragma comments on the CLI11 header files:
https://clangd.llvm.org/guides/include-cleaner#scenarios-and-solutions
If I add
#include "CLI/CLI.hpp"
instead of the three above, I get a similar warning, because of the transitive includes.
The text was updated successfully, but these errors were encountered: