79476608

Date: 2025-02-28 20:24:16
Score: 2
Natty:
Report link

Big thanks to @Tsyvarev for the comment:

You are specifying ${brt_SOURCE_DIR}/include as include directory. Assuming the full path to the header SourceModelBase.hpp is ${brt_SOURCE_DIR}/include/SourceModels/SourceModelBase.hpp, that header should be included by relative path #include <SourceModels/SourceModelBase.hpp>. If you want to include the header with plain #include "SourceModelBase.hpp", then you should add ${brt_SOURCE_DIR}/include/SourceModels to the list of include directories. (This can be done either via target_include_directories command, or by additional parameter for BASE_DIRS).

This was my problem. I failed to assess the compiler errors and focused too much on what the IDE (not the compiler) was reporting. The build stopped failing as soon as I added ${brt_SOURCE_DIR}/include/SourceModels and ${brt_SOURCE_DIR}/include/ListenerModels (which had the same issue) to the target_include_directories command. The IDE is still complaining, but the build works fine.

Reasons:
  • Blacklisted phrase (0.5): thanks
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @Tsyvarev
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Flymania117