Hi, I'm new to SFML, and I've been going through the tutorials.
I had no trouble with the "system" package, but as soon as I attempted to build a program with the "window" package I started getting the following errors:
1>------ Build started: Project: sfml_window_and_event, Configuration: Debug Win32 ------
1>Linking...
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>sfml-window-s.lib(Window.obj) : error LNK2019: unresolved external symbol "public: void __thiscall sf::Clock::Reset(void)" (?Reset@Clock@sf@@QAEXXZ) referenced in function "public: void __thiscall sf::Window::Display(void)" (?Display@Window@sf@@QAEXXZ)
1>sfml-window-s.lib(Window.obj) : error LNK2019: unresolved external symbol "void __cdecl sf::Sleep(float)" (?Sleep@sf@@YAXM@Z) referenced in function "public: void __thiscall sf::Window::Display(void)" (?Display@Window@sf@@QAEXXZ)
1>sfml-window-s.lib(Window.obj) : error LNK2019: unresolved external symbol "public: float __thiscall sf::Clock::GetElapsedTime(void)const " (?GetElapsedTime@Clock@sf@@QBEMXZ) referenced in function "public: void __thiscall sf::Window::Display(void)" (?Display@Window@sf@@QAEXXZ)
1>sfml-window-s.lib(Window.obj) : error LNK2019: unresolved external symbol "public: __thiscall sf::Clock::Clock(void)" (??0Clock@sf@@QAE@XZ) referenced in function "public: __thiscall sf::Window::Window(void)" (??0Window@sf@@QAE@XZ)
1>C:\Users\Brent\Documents\Visual Studio 2008\Projects\sfml_window_and_event\Debug\sfml_window_and_event.exe : fatal error LNK1120: 4 unresolved externals
1>Build log was saved at "file://c:\Users\Brent\Documents\Visual Studio 2008\Projects\sfml_window_and_event\sfml_window_and_event\Debug\BuildLog.htm"
1>sfml_window_and_event - 5 error(s), 1 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
This is what my code looks like:
// sfml_window_and_event.cpp : Defines the entry point for the console application.
//
#include <SFML/Window.hpp>
int main() // SFML Basics : Windows & Events
{
// Create a window object. (App)
sf::Window App(sf::VideoMode(800, 600, 32), "SFML Window");
// Displaying the window
while(App.IsOpened())
{
sf::Event Event; // Declaring an event object;
App.Display(); // Displays the Window
// Checking for a window event:
while(App.GetEvent(Event)) // All events go into a stack, we loop to ensure we've caught them all.
{
// Process event
// Window closed
if (Event.Type == sf::Event::Closed)
{App.Close();}
// Escape key pressed
if ((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::Escape))
{App.Close();}
}
}
return 0;
}
Could someone please tell me what I'm doing wrong to cause these errors?