This is a bug in JUCE. Please vote and comment here to perhaps persuade the team to implement the solution:
https://forum.juce.com/t/fr-add-explicit-includes-to-juce-modules
Now as to a few things you can do today:
-
You’d get slightly better results by not using JuceHeader and instead include the JUCE modules you’re using directly (
<juce_core/juce_core.h>), etc. -
I believe you’d get better results by adding this to the CMakeLists:
set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE INTERNAL "")
- Unfortunately due to the bug above you’d get much better results using an IDE like Visual Studio (not code), CLion or Xcode. The bug still exists in those IDEs, but much less so and you get dramatically less false positives and better auto complete.
