SFML LNK2019 problem visual studio 2010

is any one tried the SFML on visual studio 2010?
I follow the tutorial and set up all the configuration
but

1
2
3
4
5
6
7
8
9
10
#include <iostream>
#include <SFML\Graphics.hpp>
using namespace std;


int main(){
	sf::RenderWindow(sf::VideoMode(200,200),"SFML works!");
	return 0;
}


this is just my trying code and


1>main.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall sf::RenderWindow::~RenderWindow(void)" (??1RenderWindow@sf@@UAE@XZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall sf::RenderWindow::RenderWindow(class sf::VideoMode,class sf::String const &,unsigned int,struct sf::ContextSettings const &)" (??0RenderWindow@sf@@QAE@VVideoMode@1@ABVString@1@IABUContextSettings@1@@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall sf::VideoMode::VideoMode(unsigned int,unsigned int,unsigned int)" (??0VideoMode@sf@@QAE@III@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall sf::String::String(char const *,class std::locale const &)" (??0String@sf@@QAE@PBDABVlocale@std@@@Z) referenced in function _main



Keep getting link problems.....
i set up all the library and header file path thing

any ideas?
Your program can't find the functions located in the .lib.

A common mistake with both SFML and SDL is that 64 bit users link the 64 bit libraries, when they actually should link the 32 bit libraries.

Unless your specifically developing for only 64 bit systems which really no one does.
I just want to know why 64 users have to link with 32 bit libraries
just curious
closed account (jwkNwA7f)
I have just set up SFML to see what it is like and did the same thing that Lumpkin was talking about. Once I got that fixed it worked fine.
Its not that you have to use 32 bit libs, its that if you use the 64 bit libs you need to change the project configuration to match (x64).
If it isn't to do with 64-bit versus 32-bit libraires...

You mention the paths, but not the libs themselves. Have you also added the necessary libraries to you project?

I have to add the following to get your code to link (debug target, using SFML DLLs).

sfml-main-d.lib
sfml-window-d.lib
sfml-system-d.lib
sfml-graphics-d.lib

Andy

PS Did you create a console app or a Windows app to start off with? I also get

error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup

before I add the above libraries to my Windows (GUI) project.
Last edited on
closed account (jwkNwA7f)
I had to put a few of the .dll's in the same folder as the .exe to get it to work too.
Topic archived. No new replies allowed.