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

Author Topic: window.draw creates link error  (Read 3057 times)

0 Members and 1 Guest are viewing this topic.

flachead

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • Email
window.draw creates link error
« on: March 02, 2013, 11:19:03 pm »
Hello,

When I try to draw text to the screen, running in release or debug gives me the errors:

Quote
Error   1   error LNK2001: unresolved external symbol "public: static class sf::RenderStates const sf::RenderStates::Default" (?Default@RenderStates@sf@@2V12@B)   E:\Visual Studio 2010\Projects\flaccy frame\flaccy frame\main.obj   flaccy frame

and

Quote
Error   2   error LNK1120: 1 unresolved externals   E:\Visual Studio 2010\Projects\flaccy frame\Debug\flaccy frame.exe   flaccy frame

I'm pretty new to this but i'm pretty sure I have everything set up correctly, it's the only thing that has returned an error so far.

Quote
#include <SFML/Graphics.hpp>

int main()
{
   sf::VideoMode vMode( 800, 600, 32 );
   sf::RenderWindow window( vMode, "Flaccy" );

   sf::Text text("hello");

    while ( window.isOpen() )
    {
        sf::Event event;
        while ( window.pollEvent(event) )
        {
         switch ( event.type )
         {
         case sf::Event::Closed:
            window.close();
            break;

         default:
            break;
         }
           
        }

      window.clear( sf::Color( 255, 0, 0 ));
      window.draw(text);
        window.display();

    }

    return 0;
}


Visual Studio 2010 | C++ | Windows 7 x64 | GTX 570 | SFML 2.0 (downloaded it fresh yesterday)

Any help is greatly appreciated thanks...

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: window.draw creates link error
« Reply #1 on: March 02, 2013, 11:26:19 pm »
Are you linking against sfml-graphics, sfml-window and sfml-system?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

flachead

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • Email
Re: window.draw creates link error
« Reply #2 on: March 02, 2013, 11:31:56 pm »
Are you linking against sfml-graphics, sfml-window and sfml-system?

for release yes, for debug I link to sfml-system-d etc

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: window.draw creates link error
« Reply #3 on: March 02, 2013, 11:36:08 pm »
Have you defined SFML_STATIC by accident?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

flachead

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • Email
Re: window.draw creates link error
« Reply #4 on: March 02, 2013, 11:40:08 pm »
No, I had it set up as static to begin with but switched back to dynamic and removed the SMFL_STATIC reference

EDIT: I'm really sorry your right. I removed it from Release but failed horribly to remove it from Debug.

Really sorry to waste your time and thanks very much for the fast response :)
« Last Edit: March 02, 2013, 11:43:06 pm by flachead »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: window.draw creates link error
« Reply #5 on: March 02, 2013, 11:55:12 pm »
I'm glad you found the cause of the problem. :)

Really sorry to waste your time and thanks very much for the fast response :)
It wasn't wasted, since it helped you in the end. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/