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

Author Topic: Cannot run basic tutorial code on Visual Studio 2013  (Read 930 times)

0 Members and 1 Guest are viewing this topic.

ms123

  • Newbie
  • *
  • Posts: 1
    • View Profile
Cannot run basic tutorial code on Visual Studio 2013
« on: March 20, 2014, 09:08:54 pm »
Hello,

I am attempting to use SFML with Visual Studio 2013. Because there was no version of SFML that was compatible, I compiled with CMake.

I then set all of the project settings as specified in the Visual Studio tutorial.

I can run this program
#include <SFML/Graphics.hpp>
int main()
{
        //sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");     
        return 0;
}
 

but when I uncomment the RenderWindow line like this
#include <SFML/Graphics.hpp>
int main()
{
        sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");       
        return 0;
}
 

I get the following error (among others):
error LNK2019: unresolved external symbol __imp__glReadPixels@28 referenced in function "public: class sf::Image __thiscall sf::RenderWindow::capture(void)const " (?capture@RenderWindow@sf@@QBE?AVImage@2@XZ) <Path to visual studio project>\sfml-graphics-s-d.lib(RenderWindow.obj) Project1

 

Any suggestions?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10998
    • View Profile
    • development blog
    • Email
AW: Cannot run basic tutorial code on Visual Studio 2013
« Reply #1 on: March 20, 2014, 09:53:55 pm »
The linking behavior for static libs has changed ( https://github.com/SFML/SFML/wiki/FAQ#wiki-build-link-static ), you now need to link all the dependencies yourself.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

 

anything