SFML community forums

Help => General => Topic started by: nevets_19 on January 06, 2011, 05:37:10 pm

Title: SFML Wont Run Properly
Post by: nevets_19 on January 06, 2011, 05:37:10 pm
Hello, i have recently being trying to install SFML as it looks good and i would like to start programing game i follow the tutorial on this website and the time sample thing works fine but when i try to open a window nothing comes up its just a blank console window and no screen, this is my code

Code: [Select]

#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>

int main ()
{

    sf::RenderWindow Game(sf::VideoMode(800, 600, 32), "Game");

    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;


}







thanks to anyone who can help ;D
Title: SFML Wont Run Properly
Post by: Orwel on January 06, 2011, 05:45:51 pm
You had forget the main loop.


Sorry, I did not see  :oops:
Title: SFML Wont Run Properly
Post by: nevets_19 on January 06, 2011, 05:50:53 pm
yeah, i got this code off a you tube video, i am a n00b and know practically nothing and i hope to learn this main from online tutorials

i have been trying to get this to work for awhile now and i have been having soo much trouble setting it up, makes me wonder if i should just give up and try to learn something else

anyways is there anyway u could maybe give me some code that will successfully open a window XD
Title: SFML Wont Run Properly
Post by: nevets_19 on January 06, 2011, 06:10:21 pm
Quote from: "Orwel"
You had forget the main loop.


Sorry, I did not see  :oops:



eh, dw about it maybe i'll just learn SDL or something i'll try the graphics-window.cpp file this website provides and see how that goes
Title: SFML Wont Run Properly
Post by: nevets_19 on January 06, 2011, 06:29:04 pm
hmm, nothing, it does the same thing, it has come to my attention that no one cares haha
Title: SFML Wont Run Properly
Post by: Grimshaw on January 06, 2011, 06:59:08 pm
And you really aren't impatient..

What machine are you running on? What OS? Give more information please.
The code looks like ok to me..
Title: SFML Wont Run Properly
Post by: Walker on January 06, 2011, 11:39:58 pm
Quote from: "nevets_19"
hmm, nothing, it does the same thing, it has come to my attention that no one cares haha


I check my regular forums way too often (SFML included) and I somehow missed your post. So sorry about that.

Oh wait, you went from "It's not working" to "no one cares" in under an hour. This will make people want to help less.

Anyway... OS? Hardware? SFML version? Followed the setup tutorial?
Title: SFML Wont Run Properly
Post by: nevets_19 on January 07, 2011, 03:15:39 am
yeah, i didn't realize that people were gonna get angry about it, the reason for this is i am really frustrated as i have been trying o set this up and open a window several months and i'm on the brink of giving up.

i am running Windows 7 64bit

graphics card is ati radeon 5770 if that makes a difference

SFML version is 1.6

Code Blocks MinGW 4.4


and yes i followed the tutorial
Title: SFML Wont Run Properly
Post by: Groogy on January 07, 2011, 03:38:14 am
SFML 1.6? I know that there is a problem with SFML2, ATI and Dynamic libraries. Don't know if that applies to 1.6 too.

Try the static libs and see if it works.
Also, check if anything happens if you draw to the window.
And are you using 64bit version of the library?
Title: SFML Wont Run Properly
Post by: nevets_19 on January 07, 2011, 03:43:02 am
Quote from: "Groogy"
SFML 1.6? I know that there is a problem with SFML2, ATI and Dynamic libraries. Don't know if that applies to 1.6 too.

Try the static libs and see if it works.
Also, check if anything happens if you draw to the window.
And are you using 64bit version of the library?


I have No idea there even was a 64bit version of the library, as i stated b4 i am n00b
Title: SFML Wont Run Properly
Post by: Groogy on January 07, 2011, 03:45:32 am
There isn't, not compiled. I just said it since it might affect. I don't know how Windows handles it

You will have too compile it yourself if it does matter. Anyway, try out SFML2 instead since you want to learn to work with SFML. SFML1.6 is more or less out-dated by now. So since your not going to develop anything real and publish it yet you can might as well do SFML2 instead.
Title: SFML Wont Run Properly
Post by: nevets_19 on January 07, 2011, 03:48:24 am
i have installed SFMl 2.0 just now for visual c++ 2008 and now everything builds fine and its about to open (i think) and it come up with an error saying sfml-graphics.dll is missing from your computer and there is not sfml-graphics in the sfml 2.0 folder i know cause i searched it
Title: SFML Wont Run Properly
Post by: Groogy on January 07, 2011, 03:51:44 am
Then everything couldn't have being built just fine, don't you think? Doesn't the VS build of SFML say at least one failed build?

Anyway the DLL is beside the point, you should be statically linking them since you are using ATI.
Title: SFML Wont Run Properly
Post by: nevets_19 on January 07, 2011, 03:53:33 am
Quote from: "Groogy"
Then everything couldn't have being built just fine, don't you think? Doesn't the VS build of SFML say at least one failed build?

Anyway the DLL is beside the point, you should be statically linking them since you are using ATI.


thank you for all your help btw, i have made a screen shot of it so u can get a better understanding (u probably already understand but ah well)

http://img29.imageshack.us/f/errormessages.jpg/

u might need to zoom i on it its kinda small
Title: SFML Wont Run Properly
Post by: Groogy on January 07, 2011, 03:53:40 am
Also, it should be asking for: sfml-graphics-d-2.dll if you are using SFML2
Title: SFML Wont Run Properly
Post by: nevets_19 on January 07, 2011, 03:55:02 am
yeah thats Wat i was thinking, i was like wtf, that doesn't exist in the sfml2 folder :s


this is the output message from visual c++

Title: SFML Wont Run Properly
Post by: Groogy on January 07, 2011, 03:57:15 am
Anyway try cleaning your computer off anything that got to do with SFML and install SFML2 agan.

I can't help you more since I need to go to bed and sleep.
Title: SFML Wont Run Properly
Post by: nevets_19 on January 07, 2011, 04:01:35 am
Quote from: "Groogy"
Anyway try cleaning your computer off anything that got to do with SFML and install SFML2 agan.

I can't help you more since I need to go to bed and sleep.


so long
Title: SFML Wont Run Properly
Post by: Groogy on January 07, 2011, 04:04:43 am
With that information I might have figured out what was wrong. You were using release libraries while running the code in debug. Just so you think about it. The libraries with a -det are for debug.
Title: SFML Wont Run Properly
Post by: nevets_19 on January 07, 2011, 04:08:29 am
so would that fix the sfml-graphics.dll and the sfml-system.dll problem
Title: SFML Wont Run Properly
Post by: Groogy on January 07, 2011, 04:14:02 am
If you still want to use SFML 1.6 then probably. But you should also be getting a sfml-window problem.

Can you also tell me what you link and in what order?
Title: SFML Wont Run Properly
Post by: nevets_19 on January 07, 2011, 04:20:25 am
oh, i thoguht i said i have got SFMl 2.0 aswell which i'm trying it on that atm

now it asks for

sfml-window-d.dll
sfml-graphics-d.dll


WHAT THE HELL I HAD THOSE FILES IN THERE!!!!!
Title: SFML Wont Run Properly
Post by: Groogy on January 07, 2011, 04:23:22 am
You are still linking against sfml 1.6 but to fix that error just place the dll files in system32 or the same folder as the executable.
Title: SFML Wont Run Properly
Post by: nevets_19 on January 07, 2011, 04:24:20 am
ok, i have no more compile error but i am back to my original problem, FML!

this is what i have in additional dependencies

sfml-window-d.lib
sfml-graphics-d.lib
sfml-system-d.lib

also i tryed the same code and stuff on codeblocks and the window still didn't come up, only a console box

i'm thinking its my computer thats the problem
Title: SFML Wont Run Properly
Post by: nevets_19 on January 08, 2011, 06:53:27 pm
OK, i fixed it, i made a partition on my drive and installed windows xp on it and used easybdc to dual boot them so now i have a partition for programming stuff (windows xp) and a partition for gaming (windows 7)


all good now ;D