I'm trying to add a sound effect in shield.cpp
if I make a sound object then the compiler says
'ShieldManager::ShieldManager(const ShieldManager &)': attempting to reference a deleted function
if I just uncomment the sound object in shield.h it's no problem
Superweird error
Re: Superweird error
Looks like you're trying to copy ShieldManager, and the compiler doesn't like that because shield manager contains a sound.
Sounds can't be copied, they must be moved.
I recommend, for the time being, just make the Game class own the sounds. You can have ShieldManager maintain a ref& if you like.
Sounds can't be copied, they must be moved.
I recommend, for the time being, just make the Game class own the sounds. You can have ShieldManager maintain a ref& if you like.
Chili
Re: Superweird error
Thanks chili! That did the trick