I'm having some trouble in my class of loading music.
I'm trying to make a function so I can load in Music simply by calling a function and tossing in some perameters, here is what I have so far:
Load.h
#pragma onc
#include <string>
class Load
{
public:
void LoadMusic(sf::Music MusicLoaded, std::string FileName);
};
Load.cpp
#include <SFML/Audio.hpp>
#include "Load.h"
#include <string>
#include <iostream>
void LoadMusic(sf::Music MusicLoaded, std::string FileName){
if (!MusicLoaded.openFromFile(FileName)){
std::cout << "ERROR could not load " << FileName << std::endl;
}
else{
std::cout << "Loaded" << FileName << std::endl;
}
}
main()
//unimportant junk
sf::Music MenuMusic;
Load LoadOBJ;
LoadOBJ.LoadMusic(MenuMusic, "Resources/MenuMusic");
//unimportant junk
I tried to show as little code as possible, also this is only my second time ever working with classes.
errors:
\include\sfml\audio\inputsoundfile.hpp(203): error C2248: 'sf::NonCopyable::NonCopyable' : cannot access private member declared in class 'sf::NonCopyable'
sfml-2.3.1\include\sfml\system\noncopyable.hpp(67) : see declaration of 'sf::NonCopyable::NonCopyable'
sfml-2.3.1\include\sfml\system\noncopyable.hpp(42) : see declaration of 'sf::NonCopyable'
1> This diagnostic occurred in the compiler generated function 'sf::InputSoundFile::InputSoundFile(const sf::InputSoundFile &)'
sfml-2.3.1\include\sfml\system\mutex.hpp(89): error C2248: 'sf::NonCopyable::NonCopyable' : cannot access private member declared in class 'sf::NonCopyable'
sfml-2.3.1\include\sfml\system\noncopyable.hpp(67) : see declaration of 'sf::NonCopyable::NonCopyable'
sfml-2.3.1\include\sfml\system\noncopyable.hpp(42) : see declaration of 'sf::NonCopyable'
1> This diagnostic occurred in the compiler generated function 'sf::Mutex::Mutex(const sf::Mutex &)'
(I removed My Computer Name, and the name of the project from the error's as it is unimportant)
Thx in advance Y'all!!!