So using Cocos2D-X, in the AppDelegate.cpp file, I uncomment the line:
SimpleAudioEngine::sharedEngine()->pauseBackgroundMusic();
so that my audio will be paused when the app is exited. However, when I do this, I get the error stated in the title. How can I fix this?
It seems to me that you forgot to add declaration of SimpleAudioEngine. Add this lines to AppDelegate.cpp:
#include "SimpleAudioEngine.h"
using namespace CocosDenshion;
the answer from Dmitry Fomin is correct, or after you put
#include "SimpleAudioEngine.h"
you can use
CocosDenshion::SimpleAudioEngine::sharedEngine()->pauseBackgroundMusic();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With