What does this error mean?

closed account (jw6XoG1T)
im using SFML and this error keeps coming up. I compiled a project in it before perfectly but when i try to do this and make a window i get errors:


1
2
3
4
5
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall sf::Window::~Window(void)" (__imp_??1Window@sf@@UAE@XZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall sf::Window::Display(void)" (__imp_?Display@Window@sf@@QAEXXZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::Window::Window(class sf::VideoMode,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned long,struct sf::WindowSettings const &)" (__imp_??0Window@sf@@QAE@VVideoMode@1@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@KABUWindowSettings@1@@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::VideoMode::VideoMode(unsigned int,unsigned int,unsigned int)" (__imp_??0VideoMode@sf@@QAE@III@Z) referenced in function _main
1>c:\users\danielle\documents\visual studio 2010\Projects\sfml\Debug\sfml.exe : fatal error LNK1120: 4 unresolved externals



and here's my code that im using:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <SFML\Window.hpp>
#include <iostream>
#include <string>
using namespace std;
using namespace sf;

int main()
{
	Window App(VideoMode(600, 400, 32), "My Window");

	bool Running = true;
		while (Running)
	{
    App.Display();
	
}


	return EXIT_SUCCESS;
}


It's probably either a linking error or you're missing a library? How have you linked your program?

You should also try avoid using simultaneous using namespace __; since now you're using two different namespaces.
closed account (jw6XoG1T)
well i pretty much followed the tutorial on how to set it up on the SFML website for VC++ 2010....idk why it's not working
Sorry, I can't really help you if you're using VC++, I don't know that much about it. But I'm pretty sure that you either provided a wrong directory OR you're linking incorrectly. I got similar errors before I understood how to link my projects to the SFML files.
Looks like you haven't linked the SFML libraries. Make sure you do that.
Topic archived. No new replies allowed.