Expected type-specifier error when adding new SamplerVoice

Hi, I just started using JUCE a few days ago and have been stuck on this error. I am trying to build a Sampler plugin and have just started on the project. I am currently getting this error while trying to compile the code. What can I do to fix this?
I have also tried using juce::SamplerVoice() but it doesn’t make a difference. If I remove this code the project compiles without errors.

    [  2%] Building CXX object Source/CMakeFiles/AudioPluginExample.dir/PluginProcessor.cpp.o
/home/mishell/dev/AdversarialAudio/App/Source/PluginProcessor.cpp: In constructor ‘AudioPluginAudioProcessor::AudioPluginAudioProcessor()’:
/home/mishell/dev/AdversarialAudio/App/Source/PluginProcessor.cpp:16:31: error: expected type-specifier before ‘SamplerVoice’
         mSampler.addVoice(new SamplerVoice());
Source/CMakeFiles/AudioPluginExample.dir/build.make:89: recipe for target 'Source/CMakeFiles/AudioPluginExample.dir/PluginProcessor.cpp.o' failed
make[2]: *** [Source/CMakeFiles/AudioPluginExample.dir/PluginProcessor.cpp.o] Error 1
CMakeFiles/Makefile2:195: recipe for target 'Source/CMakeFiles/AudioPluginExample.dir/all' failed
make[1]: *** [Source/CMakeFiles/AudioPluginExample.dir/all] Error 2
Makefile:135: recipe for target 'all' failed
make: *** [all] Error 2

Hard to see what’s happened without more code. Best is to provide a minimal project.

It could be a problem of headers. I’m not familiar with Cmake. Thus I can not help much more.

For instance have you included “juce_audio_formats” module?