SFML C++

I am trying to learn SFML from the sites tutorial

I am using visual c++ 2008 I downloaded SFML headers library included them them in vc++ as they told in tutorial and also tried the clock.get time program worked perfectly

But when i tried to Do any other program the window just comes on screen and goes like it flashed

And If i download their file of the program same thing happens no error while debugging or anything but it just flashes and goes off

Their file also includes the user input thing but still screen doesn't wait for it
Are you sure you added all additional linker dependencies, dlls? Also, post your code.
closed account (S6k9GNh0)
*this is much more suited for the SFML forums.
You added the event loop and event handling code for the window example, right? Could you paste a link to the part of the tutorial in question?
I Took there code

See here

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Window.hpp>


////////////////////////////////////////////////////////////
/// Entry point of application
///
/// \return Application exit code
///
////////////////////////////////////////////////////////////
int main()
{
    // Create the main window
    sf::Window App(sf::VideoMode(800, 600, 32), "SFML Window");

    // Start main loop
    bool Running = true;
    while (Running)
    {
        App.Display();
    }

    return EXIT_SUCCESS;
}



And

got this error


Creating window.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall sf::Window::~Window(void)" (??1Window@sf@@UAE@XZ) referenced in function _main
1>Creating window.obj : error LNK2019: unresolved external symbol "public: void __thiscall sf::Window::Display(void)" (?Display@Window@sf@@QAEXXZ) referenced in function _main
1>Creating window.obj : error LNK2019: unresolved external symbol "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 &)" (??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>Creating window.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>C:\Documents and Settings\Chinmay\My Documents\Visual Studio 2008\Projects\Creating window\Debug\Creating window.exe : fatal error LNK1120: 4 unresolved externals
1>Build log
It looks like you didn't link with the libraries. If I recall correctly, there are more than one and they should be linked with in order. The tutorial should say this somewhere near the beginning.

You did this, right?
http://www.sfml-dev.org/tutorials/1.6/start-vc.php
Last edited on
Yes I did all the steps

Now there is no flashing window any more for first two programs

these two
# Using threads and mutexes
# Generating random numbers

But when I go for this

Window package

* Opening a window

It gives me error again
same error i posted above

and same source code
THANK YOU SO MUCH FOR YOUR ONE LINE I SEARCHED EVERY WHERE

U JUST WROTE

It looks like you didn't link with the libraries there are more than one and they should be linked with in order

AND THEN I FOUND THAT I AM NOT LINKING THE WINDOW FILE

OH MAN THANK YOU SO MUCH

one more and last question

Am I able to program a snake game or even simpler game with knowledge of c++ and SFML?

Thank you
Am I able to program a snake game or even simpler game with knowledge of c++ and SFML?


Is it possible? Sure.

Are you able? Only you can answer that.
Thank you everybody I will try to learn in and create some simple game also try to buid a snake game.

If I get stuck I will open a new topic.

Well I am marking this topic as solved but please keep looking that some times there might be a topic named as sfml help and in corner there will be my name dont for get to answer it =p
Topic archived. No new replies allowed.