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

Author Topic: [sf::Text] Error in lastest version  (Read 1975 times)

0 Members and 1 Guest are viewing this topic.

player931402

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
[sf::Text] Error in lastest version
« on: May 06, 2012, 05:39:33 pm »
Hi guys..  I have a problem

The error is in the Debug mode, in Release is all ok.

Compiling this code:

 #include <SFML/Graphics.hpp>
 #include <boost\shared_ptr.hpp>
 
 int main(void)
 {
         sf::RenderWindow *window= new sf::RenderWindow(sf::VideoMode(800, 600), "SFML window",sf::Style::Close);
       
         sf::Text testo;
         
         testo.setPosition(200,200);
         testo.setString("Hello World");

     while (window->isOpen())
     {
         sf::Event event;
         while (window->pollEvent(event))
         {
             if (event.type == sf::Event::Closed)
                 window->close();
         }
         
                 window->clear();
                 
                 window->draw(testo);

                 window->display();
     }
 
     return 0;
 }

I got this error

Code: [Select]
1>main.obj : error LNK2001: extern symbol "public: static class sf::RenderStates const sf::RenderStates::Default" (?Default@RenderStates@sf@@2V12@B)

The error is on the call of "window->draw(testo)", how can I solve ?

Ty !  :D
« Last Edit: May 06, 2012, 06:27:14 pm by Laurent »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Laurent Gomila - SFML developer

player931402

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Re: [sf::Text] Error in lastest version
« Reply #2 on: May 06, 2012, 08:01:30 pm »
Soz, i use SFML 2 ( Last build: Apr 28, 2012 9:41:33 PM (revision b7b10785) ) , MVC++ 10, windows 7
and on Release it works.
« Last Edit: May 06, 2012, 08:03:02 pm by player931402 »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: [sf::Text] Error in lastest version
« Reply #3 on: May 06, 2012, 09:26:42 pm »
If it works in release mode then check (compare) your settings: something must be wrong in debug mode.
Laurent Gomila - SFML developer

player931402

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Re: [sf::Text] Error in lastest version
« Reply #4 on: May 07, 2012, 12:41:44 am »
I solved it removing from debug configurations SFML_STATIC in the preprocessor  ;)