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

Author Topic: error 'sf' has not been declared  (Read 3667 times)

0 Members and 1 Guest are viewing this topic.

Barba Bouz

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
error 'sf' has not been declared
« on: November 04, 2012, 02:34:08 am »
The main.cpp file

#include <SFML/Graphics.h>

int main(){

sf::RenderWindow Screen(sf::VideoMode(800,600,32)"Title");
Screen.Display();
system("pause");
return 0;
}

The linkers

-lsfml-window

Its my first program in SFML. I d really like to use SFML if I set it up correctly. Can you please help I d really appreciate it. Thanks.

FRex

  • Hero Member
  • *****
  • Posts: 1848
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: error 'sf' has not been declared
« Reply #1 on: November 04, 2012, 02:39:39 am »
It shouldn't even compile. :o SFML uses .hpp not .h
Back to C++ gamedev with SFML in May 2023

Barba Bouz

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Re: error 'sf' has not been declared
« Reply #2 on: November 04, 2012, 02:42:30 am »
Everything is in .h not .hpp on my install at least. The library works though.

FRex

  • Hero Member
  • *****
  • Posts: 1848
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: error 'sf' has not been declared
« Reply #3 on: November 04, 2012, 02:45:18 am »
You sure you didn't download the CSFML(as in C version, as in, the_language_that_has_no_namespaces_so_namespace_sf_is_missing version)? It uses .h afaik, the c++ version uses .hpp
Back to C++ gamedev with SFML in May 2023

Barba Bouz

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Re: error 'sf' has not been declared
« Reply #4 on: November 04, 2012, 02:47:50 am »
oh damn....many thanks mate...you can freely bash me. :-[

 

anything