Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: [solved] error: ‘sf::Time’ has not been declared  (Read 5205 times)

0 Members and 1 Guest are viewing this topic.

nietaki

  • Newbie
  • *
  • Posts: 30
    • View Profile
    • http://almost-done.net
[solved] error: ‘sf::Time’ has not been declared
« on: February 12, 2012, 05:17:14 pm »
I am using the latest 2.0 version and everything works fine except for the sf::Time class, which isn't getting imported
Code: [Select]
#include <SFML/System.hpp>
class Widget {
  public:
    //...
    virtual void repaint(sf::RenderTarget *renderTarget, sf::Time sinceLastFrame) = 0;
};


and during compilation i get the following error:
Quote
[100%] Building CXX object renderer/CMakeFiles/renderer.dir/Widget.cpp.o
cd /home/nietaki/zpp/TheGameShow_build/renderer && /usr/bin/c++    -I/home/nietaki/zpp/TheGameShow_build -I/home/nietaki/zpp/TheGameShow/libs -I/home/nietaki/zpp/TheGameShow -I/home/nietaki/zpp/TheGameShow/google_mock/include -I/home/nietaki/zpp/TheGameShow/google_mock/gtest/include -I/usr/local/include   -o CMakeFiles/renderer.dir/Widget.cpp.o -c /home/nietaki/zpp/TheGameShow/renderer/Widget.cpp
In file included from /home/nietaki/zpp/TheGameShow/renderer/Widget.cpp:8:
/home/nietaki/zpp/TheGameShow/renderer/Widget.h:26: error: ‘sf::Time’ has not been declared


I'm sure it has something to do with the SFML_SYSTEM_API macro, but despite looking through the code I don't really understand how it works.

Any thoughts?

I'm using the latest 2.0 version from github under Linux, building shared libs.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
[solved] error: ‘sf::Time’ has not been declared
« Reply #1 on: February 12, 2012, 06:08:43 pm »
Does it work if you include <SFML/System/Time.hpp> directly?

Quote
I'm sure it has something to do with the SFML_SYSTEM_API macro

No it doesn't, "xxx has not been declared" is a compiler error, the export macro would cause linker errors ("unresolved symbol").
Laurent Gomila - SFML developer

nietaki

  • Newbie
  • *
  • Posts: 30
    • View Profile
    • http://almost-done.net
[solved] error: ‘sf::Time’ has not been declared
« Reply #2 on: February 12, 2012, 06:34:39 pm »
I'm sorry, I don't know why I ever doubt your work....

I was using and older version of SFML from the system path instead of the one I installed elsewhere.

Sometimes I need a bonce over the head instead of technical help ;)

 

anything