"juce::Grid" class undefined?


#1

Hi,

I have a project (audio plugin) that uses Grid class and I cannot compile it.
error C2079: ‘grid’ uses undefined class ‘juce::Grid’

I am using JUCE 5.2. My system is Windows 10 (with 10.0.10240.0 as target platform). I am using msbuild form VC++ 2015 Native Build Tools Command Prompt :wink:

I redownloaded JUCE already and resaved my project too. I tried this with completely new project also. I even tried to compile examples from ADC workshop and they didn’t work too.

Am I missing something?


#2

Perhaps too old Visual Studio version?


#3

Just out of curiosity I gave a fruity operating system a chance :wink: and XCode 8.2.1 told me this:

…/…/include/XXX/XXX/XXX.hpp:28:10: error: field has incomplete type 'juce::Grid’
Grid grid;
^
In file included from /Users/XXX/XXX/XXX/XXX.cpp:5:
In file included from …/…/include/XXX.hpp:8:
In file included from …/…/include/XXX.hpp:8:
In file included from …/…/JuceLibraryCode/JuceHeader.h:18:
In file included from /Library/JUCE/modules/juce_audio_plugin_client/juce_audio_plugin_client.h:53:
/Library/JUCE/modules/juce_gui_basics/juce_gui_basics.h:161:12: note: forward declaration of 'juce::Grid’
class Grid;
^
1 error generated.


#4

I can compile code with

juce::Grid grid; 

here with Visual Studio 2017 15.5 preview 5, with JUCE from the development branch.


#5

It’s one of the classes that only works with newer compilers, and you seem to be trying to use some old ones.

The error in Xcode is just our mistake in not fully disabling the class for that particular compiler version - I’ll push a fix for that to develop, but if you want to use this class you’ll need a proper C++14 compiler.


#6

I think support for C++14 was pretty good in XCode 8.2, but it needs to be separately enabled in the project settings… edit : I can’t check this now though, I no longer have XCode 8 installed…


#7

Yes, I think that’s probably true, if it’s set to C++14 in the projucer then it should work OK


#8

Yup, it compiles when I change project settings. Thanks!