SFML community forums

Help => Network => Topic started by: hacky on May 19, 2009, 07:53:16 pm

Title: ftp & renderwindow?
Post by: hacky on May 19, 2009, 07:53:16 pm
when im using a renderwindow

RenderWindow App;

& adding

Ftp server;

i also get an runtime error =/

separately all work fine
Title: ftp & renderwindow?
Post by: Laurent on May 19, 2009, 08:04:17 pm
Hi

Please show us a minimal example that reproduces the problem,
and give informations about your configuration / OS / SFML version / etc.
Title: ftp & renderwindow?
Post by: hacky on May 19, 2009, 08:13:05 pm
Code: [Select]
#include <SFML/Graphics.hpp>
#include <SFML/Network.hpp>

using namespace std;
using namespace sf;

Ftp Server;
RenderWindow App;

int main()
{
    App.Create(VideoMode(800, 600, 32), "SFML Window");
    App.SetFramerateLimit(60);

    while (App.IsOpened())
    {
        Event Event;
        while (App.GetEvent(Event))
        {
            // Window closed
            if (Event.Type == Event::Closed)
                App.Close();

            // Escape key pressed
            if ((Event.Type == Event::KeyPressed) && (Event.Key.Code == sf::Key::Escape))
                App.Close();

        }

        App.Display();


    }
    return EXIT_SUCCESS;
}


windows vista sfml 1.4

adding the "Ftp Server;" makes the runtime error but when i do it in a console application it works fine =/
Title: ftp & renderwindow?
Post by: Tank on May 19, 2009, 08:34:16 pm
Code: [Select]
Event Event;
One of the main reasons NOT to import namespaces...
Title: ftp & renderwindow?
Post by: hacky on May 19, 2009, 08:36:38 pm
Quote from: "Tank"
Code: [Select]
Event Event;
One of the main reasons NOT to import namespaces...


well that doesnt solve my problem
Title: ftp & renderwindow?
Post by: Laurent on May 20, 2009, 11:04:48 am
You didn't answer my second question
Quote
configuration / OS / SFML version

And what does the error message say exactly?

Are you sure you're not mixing debug and release configurations?
Title: ftp & renderwindow?
Post by: hacky on May 20, 2009, 12:34:17 pm
codeblocks with this linker options:
-lsfml-graphics
-lsfml-window
-lsfml-system
-lsfml-network

and now i tried this..
Code: [Select]
#include <SFML/Graphics.hpp>
#include <SFML/Network.hpp>

using namespace std;
using namespace sf;

RenderWindow App;
Ftp server;


int main()
{
    return EXIT_SUCCESS;
}



adding the Ftp server also makes an runtime error here =/

(http://img3.imagebanana.com/img/7w9va4zw/error.jpg)
Title: ftp & renderwindow?
Post by: Laurent on May 20, 2009, 12:36:25 pm
Quote
codeblocks with this linker options:
-lsfml-graphics
-lsfml-window
-lsfml-system
-lsfml-network

In debug mode it should be
Quote
-lsfml-graphics-d
-lsfml-window-d
-lsfml-system-d
-lsfml-network-d
Title: ftp & renderwindow?
Post by: hacky on May 20, 2009, 12:40:02 pm
the error still comes =/
Title: ftp & renderwindow?
Post by: Tank on May 20, 2009, 02:22:10 pm
Take care of ordering:
Code: [Select]

-lsfml-system-d
-lsfml-window-d
-lsfml-graphics-d
-lsfml-network-d
Title: ftp & renderwindow?
Post by: hacky on May 20, 2009, 02:30:35 pm
still no changes =(((
Title: ftp & renderwindow?
Post by: hacky on May 20, 2009, 10:02:47 pm
well i splitted the ftp part in an extra programm ..it works fine but thats not the best solution =/
Title: ftp & renderwindow?
Post by: Laurent on May 20, 2009, 10:46:24 pm
Maybe you can put it in a try/catch block, the error looks like an uncaught exception.

If it's not the case, you can try using a debugger to get more informations about the error.