SFML community forums

Help => General => Topic started by: ms123 on March 20, 2014, 09:08:54 pm

Title: Cannot run basic tutorial code on Visual Studio 2013
Post by: ms123 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?
Title: AW: Cannot run basic tutorial code on Visual Studio 2013
Post by: eXpl0it3r 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.