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

Author Topic: Problems setting up SFML RC2.0 VS2010  (Read 2538 times)

0 Members and 1 Guest are viewing this topic.

Spankenstein

  • Newbie
  • *
  • Posts: 5
    • View Profile
Problems setting up SFML RC2.0 VS2010
« on: August 21, 2012, 01:33:48 pm »
I have downloaded the RC version of SFML for Visual Studio C++ 2010 http://www.sfml-dev.org/download/2.0-rc/SFML-2.0-rc-windows-32-vc2010.zip

I have followed the instructions on this page for the static library linking.

I have created a new console project with the code from the setup guide:

#include "stdafx.h"
#include <SFML/Graphics.hpp>

int _tmain(int argc, _TCHAR* argv[])
{
        sf::RenderWindow window(sf::VideoMode(300, 200), "SFML works!");
    sf::Text text("Hello SFML");

    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();
        }

        window.clear();
        window.draw(text);
        window.display();
    }

    return 0;
}
 

I will not compile because of the following error:


Error   1   error LNK2001: unresolved external symbol "public: static class sf::RenderStates const sf::RenderStates::Default" (?Default@RenderStates@sf@@2V12@B)


I have cleaned and rebuilt the project and it doesn't solve the issue.

I have a NVIDIA GeForce GTX680 graphics card with the latest drivers.

I'm running Windows 7 64-bit#

All configurations include 'SFML_STATIC' as a preprocessor definition.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Problems setting up SFML RC2.0 VS2010
« Reply #1 on: August 21, 2012, 01:39:57 pm »
And you're linking against all the needed sfml libraries (as descriped in the tutorial)?

Btw it's adviced to create any empty project and start from there without the precompiled stuff (i.e. stdafx.h). ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Spankenstein

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Problems setting up SFML RC2.0 VS2010
« Reply #2 on: August 21, 2012, 02:08:30 pm »
Quote
Btw it's adviced to create any empty project and start from there without the precompiled stuff (i.e. stdafx.h)

#include <SFML/Graphics.hpp>

int main()
{
    sf::RenderWindow window(sf::VideoMode(300, 200), "SFML works!");
    sf::Text text("Hello SFML");

    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();
        }

        window.clear();
        window.draw(text);
        window.display();
    }

    return 0;
}
 

That's done.

Quote
And you're linking against all the needed sfml libraries (as descriped in the tutorial)?

Yes.  Example:


eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Problems setting up SFML RC2.0 VS2010
« Reply #3 on: August 21, 2012, 02:13:00 pm »
Hmm read the tutorial again. There are diffrent types of libraries:
  • sfml-xyz.lib = release dynamic
  • sfml-xyz-d.lib = debug dynamic
  • sfml-xyz-s.lib = release static
  • sfml-xyz-s-d.lib = debug static
So you're using dynamic libraries but try to link statically this does obviously not work. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Spankenstein

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Problems setting up SFML RC2.0 VS2010
« Reply #4 on: August 21, 2012, 02:59:05 pm »
Ah I see.  A small but important oversight on my behalf! :)

Thank you for pointing that out.

I'm getting lots of warnings along the lines of:


Warning   28   warning LNK4099: PDB 'sfml-window-s-d.pdb' was not found with 'sfml-window-s-d.lib(WindowImplWin32.cpp.obj)' or at 'some\other\directory'; linking object as if no debug info


Are they easy to fix?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Problems setting up SFML RC2.0 VS2010
« Reply #5 on: August 21, 2012, 03:02:58 pm »
The SFML binaries do not ship with the debug information (= pdb file) thus if an error occures in SFML (which shouldn't happen anyways) the debugger wouldn't really be able to jump in. You can safely ignore those warnings or even disable it by adding /ignore:4099 to the linker settings. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Spankenstein

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Problems setting up SFML RC2.0 VS2010
« Reply #6 on: August 21, 2012, 03:41:24 pm »
The /IGNORE: doesn't work for additional options on the command line.

Can I generate the .pdb file by rebuilding from source?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Problems setting up SFML RC2.0 VS2010
« Reply #7 on: August 21, 2012, 03:42:57 pm »
The /IGNORE: doesn't work for additional options on the command line.
What? ???

Can I generate the .pdb file by rebuilding from source?
Sure if you rebuild from source (and don't delete the pdb files) then you'll get them. :)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Spankenstein

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Problems setting up SFML RC2.0 VS2010
« Reply #8 on: August 21, 2012, 04:02:12 pm »
Quote
What?

See: http://stackoverflow.com/questions/661606/visual-c-how-to-disable-specific-linker-warnings

Thank you for your help in getting me started.  'tis much appreciated :)