Noob Visual Studio question (intellisense)

Hopefully someone has run into this issue with VS intellisense and can shed some light on a best practice solution:

If I open the demo AudioPlugin project in VS Express 2013 for Desktop and build it, everything works fine. No errors, I can load the dll in Bitwig and play some sine voices. If I open the the PluginEditor and PluginProcessor files, header or source, they display nicely and have working Intellisense and all that.

Now if I go to a module file, say juce_synthesizer.cpp in juce_audio_basics/synthesizers, there are red squiggles everywhere. It claims that it doesn't know what SynthesiserSound is, or anything else for that matter. Bear in mind that the SynthesizerSound definition is found for PluginProcessor.cpp which defines the SinceWaveVoice class which references the sound, so it's saying different things in different files in the same project.

If I then open the associated header file, juce_synthesizer.h in this case, then suddenly the cpp is ok too, except for things like ReferencedCountedObject and such from other modules. But now it knows what a SynthesizerSound is everywhere.

This is with no modifications to any file, and it builds correctly either way, it's just a question of Intellisense working or not based on whether a header file has been opened in the current session.

I'm still pretty new to large C++ projects and I don't remember having an issue like this, where the VS compiler (or whatever Intellisense is using) has to have a file open in order to see its definitions consistently (at work we have a C++ project using LibKML that it is quite complex and it doesn't have this issue). Is there a general solution to stuff like this? Is it because the files aren't copied locally for that project? Is there a way to use precompiled headers to let the first build get Intellisense working more consistently afterwards? Or are people just used to opening headers every time they need to use a type so that Intellisense stops thinking there is an error?

Thanks for any insight,


As an added note that seems to be related, I see some weird behavior in juce_Sampler.h in that same demo project as well.

For example, it says that AudioSampleBuffer and String are undefined, and won't do anything with variables of those types, but it shows the documentation comments for the classes on mouseover. So like in the SamplerSound constructor where it has "const String& name", it complains that String is undefined, but also shows the whole "The Juce String!" comment block, meaning it actually does know the metadata for the type and found the file and all that.

Update: VS complains that ReferenceCountedObject in juce_Synthesizer.h in that same demo project is "not a class or struct name". Actually there are so many little definition issues that although it does build, I don't see how anybody would be able to use the IDE like this. Is anybody here working with Juce in VS? Are you using a specific version, or did you have to do anything to get the demos to play nice in the IDE? Again, builds and compiles are fine, but Intellisense is not, in untouched demo projects.

Thanks for any replies,


Hi Adrian - check this thread:

For some reason, Intellisense doesn't seem to work too well when you don't have a local copy of the modules. Create a local copy from Introjucer and see if your problem goes away.