I am using Micrsoft visual studios C++ 2008
I opened a C++ console window after installing and following all the directions for install and including all the libraries for the project.
This is the code
#include "stdafx.h"
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
#include <iostream>
int main() {
sf::RenderWindow Game(sf::VideoMode (800, 600, 32), "SFML window test" );
sf::Event Event;
while(Game.IsOpened())
{
while(Game.GetEvent(Event)) {
if ( Event.Type == sf::Event::Closed)
Game.Close();
}
Game.Clear();
Game.Display();
}
return EXIT_SUCCESS;
}
And here are the errors
1>Linking...
1>Testing_sfml.obj : error LNK2028: unresolved token (0A0003A9) "public: void __thiscall sf::Window::Display(void)" (?Display@Window@sf@@$$FQAEXXZ) referenced in function "int __cdecl main(void)" (?main@@$$HYAHXZ)
1>Testing_sfml.obj : error LNK2028: unresolved token (0A0003AA) "public: __thiscall sf::Color::Color(unsigned char,unsigned char,unsigned char,unsigned char)" (??0Color@sf@@$$FQAE@EEEE@Z) referenced in function "int __cdecl main(void)" (?main@@$$HYAHXZ)
1>Testing_sfml.obj : error LNK2028: unresolved token (0A0003AB) "public: void __thiscall sf::RenderTarget::Clear(class sf::Color const &)" (?Clear@RenderTarget@sf@@$$FQAEXABVColor@2@@Z) referenced in function "int __cdecl main(void)" (?main@@$$HYAHXZ)
1>Testing_sfml.obj : error LNK2028: unresolved token (0A0003AC) "public: void __thiscall sf::Window::Close(void)" (?Close@Window@sf@@$$FQAEXXZ) referenced in function "int __cdecl main(void)" (?main@@$$HYAHXZ)
1>Testing_sfml.obj : error LNK2028: unresolved token (0A0003AD) "public: bool __thiscall sf::Window::GetEvent(class sf::Event &)" (?GetEvent@Window@sf@@$$FQAE_NAAVEvent@2@@Z) referenced in function "int __cdecl main(void)" (?main@@$$HYAHXZ)
1>Testing_sfml.obj : error LNK2028: unresolved token (0A0003AE) "public: bool __thiscall sf::Window::IsOpened(void)const " (?IsOpened@Window@sf@@$$FQBE_NXZ) referenced in function "int __cdecl main(void)" (?main@@$$HYAHXZ)
1>Testing_sfml.obj : error LNK2028: unresolved token (0A0003AF) "public: virtual __thiscall sf::RenderWindow::~RenderWindow(void)" (??1RenderWindow@sf@@$$FUAE@XZ) referenced in function "int __cdecl main(void)" (?main@@$$HYAHXZ)
1>Testing_sfml.obj : error LNK2028: unresolved token (0A0003B0) "public: __thiscall sf::VideoMode::VideoMode(unsigned int,unsigned int,unsigned int)" (??0VideoMode@sf@@$$FQAE@III@Z) referenced in function "int __cdecl main(void)" (?main@@$$HYAHXZ)
1>Testing_sfml.obj : error LNK2028: unresolved token (0A0003B1) "public: __thiscall sf::RenderWindow::RenderWindow(class sf::VideoMode,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned long,struct sf::WindowSettings const &)" (??0RenderWindow@sf@@$$FQAE@VVideoMode@1@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@KABUWindowSettings@1@@Z) referenced in function "int __cdecl main(void)" (?main@@$$HYAHXZ)
1>Testing_sfml.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall sf::RenderWindow::~RenderWindow(void)" (??1RenderWindow@sf@@$$FUAE@XZ) referenced in function "int __cdecl main(void)" (?main@@$$HYAHXZ)
1>Testing_sfml.obj : error LNK2019: unresolved external symbol "public: void __thiscall sf::Window::Display(void)" (?Display@Window@sf@@$$FQAEXXZ) referenced in function "int __cdecl main(void)" (?main@@$$HYAHXZ)
1>Testing_sfml.obj : error LNK2019: unresolved external symbol "public: void __thiscall sf::RenderTarget::Clear(class sf::Color const &)" (?Clear@RenderTarget@sf@@$$FQAEXABVColor@2@@Z) referenced in function "int __cdecl main(void)" (?main@@$$HYAHXZ)
1>Testing_sfml.obj : error LNK2019: unresolved external symbol "public: __thiscall sf::Color::Color(unsigned char,unsigned char,unsigned char,unsigned char)" (??0Color@sf@@$$FQAE@EEEE@Z) referenced in function "int __cdecl main(void)" (?main@@$$HYAHXZ)
1>Testing_sfml.obj : error LNK2019: unresolved external symbol "public: void __thiscall sf::Window::Close(void)" (?Close@Window@sf@@$$FQAEXXZ) referenced in function "int __cdecl main(void)" (?main@@$$HYAHXZ)
1>Testing_sfml.obj : error LNK2019: unresolved external symbol "public: bool __thiscall sf::Window::GetEvent(class sf::Event &)" (?GetEvent@Window@sf@@$$FQAE_NAAVEvent@2@@Z) referenced in function "int __cdecl main(void)" (?main@@$$HYAHXZ)
1>Testing_sfml.obj : error LNK2019: unresolved external symbol "public: bool __thiscall sf::Window::IsOpened(void)const " (?IsOpened@Window@sf@@$$FQBE_NXZ) referenced in function "int __cdecl main(void)" (?main@@$$HYAHXZ)
1>Testing_sfml.obj : error LNK2019: unresolved external symbol "public: __thiscall sf::RenderWindow::RenderWindow(class sf::VideoMode,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned long,struct sf::WindowSettings const &)" (??0RenderWindow@sf@@$$FQAE@VVideoMode@1@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@KABUWindowSettings@1@@Z) referenced in function "int __cdecl main(void)" (?main@@$$HYAHXZ)
1>Testing_sfml.obj : error LNK2019: unresolved external symbol "public: __thiscall sf::VideoMode::VideoMode(unsigned int,unsigned int,unsigned int)" (??0VideoMode@sf@@$$FQAE@III@Z) referenced in function "int __cdecl main(void)" (?main@@$$HYAHXZ)
1>C:\Users\michalan\Documents\Visual Studio 2008\Projects\Testing_sfml\Debug\Testing_sfml.exe : fatal error LNK1120: 18 unresolved externals