Hello!
I am relatively new to C++ and sfml, so this question might be obvious to some:
I am attempting to build the following:
#include<SFML/System.hpp>
#include <iostream>
int main()
{
sf::Clock Clock;
while(Clock.getElapsedTime() < 5.f)
{
std::cout << Clock.getElapsedTime() << std::endl;
sf::sleep(0.5f);
}
return 0;
}
and I recieve compiler errors, telling me that it cannot find a match for an operater that takes a float as an argument: specifically:
/data/workspace/SFML-Sandbox/main.cpp:7:36: error: no match for ‘operator<’ in ‘Clock.sf::Clock::getElapsedTime() < 5.0e+0f’
/data/workspace/SFML-Sandbox/main.cpp:7:36: note: candidates are:
/usr/include/SFML/System/String.hpp:440:22: note: bool sf::operator<(const sf::String&, const sf::String&)
/usr/include/SFML/System/String.hpp:440:22: note: no known conversion for argument 1 from ‘sf::Time’ to ‘const sf::String&’
/usr/include/SFML/System/Time.hpp:185:22: note: bool sf::operator<(sf::Time, sf::Time)
/usr/include/SFML/System/Time.hpp:185:22: note: no known conversion for argument 2 from ‘float’ to ‘sf::Time’
and
/data/workspace/SFML-Sandbox/main.cpp:9:43: error: no match for ‘operator<<’ in ‘std::cout << Clock.sf::Clock::getElapsedTime()’
I have tried compiling this from both code::blocks and eclipse, as well as the command line - for both IDEs, I am using the defaults(as per the archlinux official repos), only ensuring that the appropriate libraries are listed - although I am not even getting object code to link! I have also tried both the git snapshot, the 1.6 version from AUR, and the archlinux community repos.
are there any additional steps I need to take when compiling?
if so, how would I propose an edit to the tutorial? (it doesn't mention any specific steps for compilation.)
thank you for your time!