Hello,
I downloaded SFML today and have been looking through what people have done using it..
Now anyway, i'm fairly new to C++ but as I have learnt Action-Script 3.0 (Big improvement from 2.0 as it is now OOP so it can relate more to other languages) I understand the fundamentals and I am learning quickly.
I am using Visual Studio 2010 Express for my C++ programming and I have compiled SFML for use with this version of VS. I attempted the very first tutorial where it takes a look at the Clock. This worked for me perfectly fine so I then went on to make a window using the Graphics class.
I created a new Win32 Project called WindowProject and then set it to be "Empty". I went into WindowProject's properties and set the Configuration to be All Configurations.
In Configuration Properties > VC++ Directories I added C:\SFML-1.6\include; in the "Include Directories" field and in the Library Directories field I added "C:\SFML-1.6\lib\vc2010;".
In Linker > Input > Additional Dependencies I put sfml-graphics-s.lib; I also put the file sfml-graphics-s.lib into the location where my .exe would be.
The code I used was exactly the same as the tutorial and when compiling I get these errors:
1>------ Build started: Project: WindowProject, Configuration: Debug Win32 ------
1>sfml-graphics-s.lib(RenderWindow.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in main.obj
1>sfml-graphics-s.lib(RenderTarget.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in main.obj
1>sfml-graphics-s.lib(Color.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in main.obj
1>sfml-graphics-s.lib(Image.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in main.obj
1>sfml-graphics-s.lib(View.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in main.obj
1>sfml-graphics-s.lib(GraphicsContext.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in main.obj
1>sfml-graphics-s.lib(Drawable.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in main.obj
1>sfml-graphics-s.lib(ImageLoader.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in main.obj
1>sfml-graphics-s.lib(Matrix3.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in main.obj
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall sf::Window::Display(void)" (?Display@Window@sf@@QAEXXZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall sf::Window::Close(void)" (?Close@Window@sf@@QAEXXZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: bool __thiscall sf::Window::GetEvent(class sf::Event &)" (?GetEvent@Window@sf@@QAE_NAAVEvent@2@@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: bool __thiscall sf::Window::IsOpened(void)const " (?IsOpened@Window@sf@@QBE_NXZ) 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>sfml-graphics-s.lib(RenderWindow.obj) : error LNK2019: unresolved external symbol "public: virtual __thiscall sf::Window::~Window(void)" (??1Window@sf@@UAE@XZ) referenced in function "public: virtual __thiscall sf::RenderWindow::~RenderWindow(void)" (??1RenderWindow@sf@@UAE@XZ)
1>sfml-graphics-s.lib(RenderWindow.obj) : error LNK2019: unresolved external symbol "public: __thiscall sf::Window::Window(void)" (??0Window@sf@@QAE@XZ) referenced in function "public: __thiscall sf::RenderWindow::RenderWindow(void)" (??0RenderWindow@sf@@QAE@XZ)
1>sfml-graphics-s.lib(RenderWindow.obj) : error LNK2001: unresolved external symbol "private: virtual void __thiscall sf::Window::OnEvent(class sf::Event const &)" (?OnEvent@Window@sf@@EAEXABVEvent@2@@Z)
1>sfml-graphics-s.lib(RenderWindow.obj) : error LNK2019: unresolved external symbol "public: void __thiscall sf::Window::Create(class sf::VideoMode,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned long,struct sf::WindowSettings const &)" (?Create@Window@sf@@QAEXVVideoMode@2@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@KABUWindowSettings@2@@Z) referenced in function "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@@QAE@VVideoMode@1@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@KABUWindowSettings@1@@Z)
1>sfml-graphics-s.lib(RenderWindow.obj) : error LNK2019: unresolved external symbol "public: void __thiscall sf::Window::Create(void *,struct sf::WindowSettings const &)" (?Create@Window@sf@@QAEXPAXABUWindowSettings@2@@Z) referenced in function "public: __thiscall sf::RenderWindow::RenderWindow(void *,struct sf::WindowSettings const &)" (??0RenderWindow@sf@@QAE@PAXABUWindowSettings@1@@Z)
1>sfml-graphics-s.lib(RenderWindow.obj) : error LNK2019: unresolved external symbol "public: bool __thiscall sf::Window::SetActive(bool)const " (?SetActive@Window@sf@@QBE_N_N@Z) referenced in function "private: virtual bool __thiscall sf::RenderWindow::Activate(bool)" (?Activate@RenderWindow@sf@@EAE_N_N@Z)
1>sfml-graphics-s.lib(Image.obj) : error LNK2001: unresolved external symbol "public: bool __thiscall sf::Window::SetActive(bool)const " (?SetActive@Window@sf@@QBE_N_N@Z)
1>sfml-graphics-s.lib(RenderWindow.obj) : error LNK2019: unresolved external symbol "public: unsigned int __thiscall sf::Window::GetWidth(void)const " (?GetWidth@Window@sf@@QBEIXZ) referenced in function "public: virtual unsigned int __thiscall sf::RenderWindow::GetWidth(void)const " (?GetWidth@RenderWindow@sf@@UBEIXZ)
1>sfml-graphics-s.lib(RenderWindow.obj) : error LNK2019: unresolved external symbol "public: unsigned int __thiscall sf::Window::GetHeight(void)const " (?GetHeight@Window@sf@@QBEIXZ) referenced in function "public: virtual unsigned int __thiscall sf::RenderWindow::GetHeight(void)const " (?GetHeight@RenderWindow@sf@@UBEIXZ)
1>sfml-graphics-s.lib(GraphicsContext.obj) : error LNK2019: unresolved external symbol "public: void __thiscall sf::Context::SetActive(bool)" (?SetActive@Context@sf@@QAEX_N@Z) referenced in function "public: __thiscall sf::priv::GraphicsContext::GraphicsContext(void)" (??0GraphicsContext@priv@sf@@QAE@XZ)
1>sfml-graphics-s.lib(GraphicsContext.obj) : error LNK2019: unresolved external symbol "public: static class sf::Context & __cdecl sf::Context::GetGlobal(void)" (?GetGlobal@Context@sf@@SAAAV12@XZ) referenced in function "public: __thiscall sf::priv::GraphicsContext::GraphicsContext(void)" (??0GraphicsContext@priv@sf@@QAE@XZ)
1>sfml-graphics-s.lib(GraphicsContext.obj) : error LNK2019: unresolved external symbol "public: static bool __cdecl sf::Context::IsContextActive(void)" (?IsContextActive@Context@sf@@SA_NXZ) referenced in function "public: __thiscall sf::priv::GraphicsContext::GraphicsContext(void)" (??0GraphicsContext@priv@sf@@QAE@XZ)
1>MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup
1>C:\Users\Kaine\Documents\Visual Studio 2010\Projects\WindowProject\Debug\WindowProject.exe : fatal error LNK1120: 17 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Im sure it is something very simple im just overlooking or have done wrong.. I hope you guys can help (Im sure you can
)
Thanks in advance - Kaine