well basically my tutors giving us a basic shell of a scroller and we have to create our own classes and put all our variables such as lives, energy, score etc... in them classes then make them work in the cpp he's given us...
If your 'lives' variable is global as it seems to be from your post, then it's not part of a class... so you're doing it wrong.
As for your other problem... are you sure both 'int.cpp' and 'main.cpp' are part of your project? This error could only be caused by them not being linked together, which indicates one of them (whichever one has the 'extern', in this case 'main.cpp') isn't part of your project.
i need to store my lives, energy and score in my own classes (creating my own header file and cpp file with it) and i should be able to use these in the cpp that my tutor gave us which will render them to a display window
//Monitoring the display function
std::stringstream str;
str<<"Score: "<<timeAccumulator;//displays the score
str<<" Energy: "<<energy;//displays the energy bar
str<<" Lives: "<<lives;//displays the number of lives
std::string s;
std::getline(str,s);
str.clear();
sf::String TextScore(s.c_str(),sf::Font::GetDefaultFont(),15);
TextScore.SetPosition(0,100);
TextScore.SetColor(sf::Color(255, 0, 0));
App.Draw(TextScore);
thats my problem that i need to use the lives and energy in the above code but in my own cpp.