Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: SFML Wont Run Properly  (Read 9185 times)

0 Members and 1 Guest are viewing this topic.

nevets_19

  • Newbie
  • *
  • Posts: 43
    • View Profile
SFML Wont Run Properly
« 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

Orwel

  • Full Member
  • ***
  • Posts: 208
    • View Profile
SFML Wont Run Properly
« Reply #1 on: January 06, 2011, 05:45:51 pm »
You had forget the main loop.


Sorry, I did not see  :oops:

nevets_19

  • Newbie
  • *
  • Posts: 43
    • View Profile
SFML Wont Run Properly
« Reply #2 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

nevets_19

  • Newbie
  • *
  • Posts: 43
    • View Profile
SFML Wont Run Properly
« Reply #3 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

nevets_19

  • Newbie
  • *
  • Posts: 43
    • View Profile
SFML Wont Run Properly
« Reply #4 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

Grimshaw

  • Hero Member
  • *****
  • Posts: 631
  • Nephilim SDK
    • View Profile
SFML Wont Run Properly
« Reply #5 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..

Walker

  • Full Member
  • ***
  • Posts: 181
    • View Profile
SFML Wont Run Properly
« Reply #6 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?

nevets_19

  • Newbie
  • *
  • Posts: 43
    • View Profile
SFML Wont Run Properly
« Reply #7 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

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
SFML Wont Run Properly
« Reply #8 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?
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

nevets_19

  • Newbie
  • *
  • Posts: 43
    • View Profile
SFML Wont Run Properly
« Reply #9 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

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
SFML Wont Run Properly
« Reply #10 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.
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

nevets_19

  • Newbie
  • *
  • Posts: 43
    • View Profile
SFML Wont Run Properly
« Reply #11 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

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
SFML Wont Run Properly
« Reply #12 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.
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

nevets_19

  • Newbie
  • *
  • Posts: 43
    • View Profile
SFML Wont Run Properly
« Reply #13 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

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
SFML Wont Run Properly
« Reply #14 on: January 07, 2011, 03:53:40 am »
Also, it should be asking for: sfml-graphics-d-2.dll if you are using SFML2
Developer and Maker of rbSFML and Programmer at Paradox Development Studio