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

Author Topic: Crash error with Windows Vista / Visual Studio 2008  (Read 9131 times)

0 Members and 3 Guests are viewing this topic.

ncarrasco

  • Newbie
  • *
  • Posts: 9
    • View Profile
Crash error with Windows Vista / Visual Studio 2008
« on: January 30, 2010, 06:10:15 pm »
Hi,

I followed all the instructions to setup Visual Studio 2008 and the project to link the static libraries,

the release mode to the release libraries:
sfml-system-s.lib sfml-graphics-s.lib sfml-window-s.lib sfml-audio-s.lib sfml-network-s.lib

debug mode:
sfml-system-s-d.lib sfml-graphics-s-d.lib sfml-window-s-d.lib sfml-audio-s-d.lib sfml-network-s-d.lib

The project complies successfully but it crashes when it runs: saying "Game.exe stopped working".

Any help would be appreciated.

Thanks in advance,
Nicolas.


The code is:
(it also doesn't work with the first example of Window tutorial).

Code: [Select]
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Graphics.hpp>
#include <iostream>


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

    // Start game loop
    while (App.IsOpened())
    {
        // Process events
        sf::Event Event;
        while (App.GetEvent(Event))
        {
            // Close window : exit
            if (Event.Type == sf::Event::Closed)
                App.Close();
        }

        // Clear screen
        App.Clear();

        // Draw predefined shapes
        App.Draw(sf::Shape::Line(10, 10, 710, 100, 15, sf::Color::Red));
        App.Draw(sf::Shape::Circle(200, 200, 100, sf::Color::Yellow, 10, sf::Color::Blue));
        App.Draw(sf::Shape::Rectangle(350, 200, 600, 350, sf::Color::Green));

        // Build a custom convex shape
        sf::Shape Polygon;
        Polygon.AddPoint(0, -50,  sf::Color(255, 0, 0),     sf::Color(0, 128, 128));
        Polygon.AddPoint(50, 0,   sf::Color(255, 85, 85),   sf::Color(0, 128, 128));
        Polygon.AddPoint(50, 50,  sf::Color(255, 170, 170), sf::Color(0, 128, 128));
        Polygon.AddPoint(0, 100,  sf::Color(255, 255, 255), sf::Color(0, 128, 128));
        Polygon.AddPoint(-50, 50, sf::Color(255, 170, 170), sf::Color(0, 128, 128));
        Polygon.AddPoint(-50, 0,  sf::Color(255, 85, 85),   sf::Color(0, 128, 128));

        // Define an outline width
        Polygon.SetOutlineWidth(10);

        // Disable filling and enable the outline
        Polygon.EnableFill(false);
        Polygon.EnableOutline(true);

        // We can still use the functions common to all SFML drawable objects
        Polygon.SetColor(sf::Color(255, 255, 255, 200));
        Polygon.Move(300, 300);
        Polygon.Scale(3, 2);
        Polygon.Rotate(45);

        // Draw it
        App.Draw(Polygon);

        // Finally, display the rendered frame on screen
        App.Display();
    }

    return EXIT_SUCCESS;
}

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Crash error with Windows Vista / Visual Studio 2008
« Reply #1 on: January 30, 2010, 07:00:31 pm »
Compile in debug mode, then run the debugger (F5). It will tell you where exactly the crash happens.
Laurent Gomila - SFML developer

ncarrasco

  • Newbie
  • *
  • Posts: 9
    • View Profile
Crash error with Windows Vista / Visual Studio 2008
« Reply #2 on: January 31, 2010, 05:25:00 pm »
Many thanks, Laurent!

The line which is the error is : App.Clear();

I don't have idea of what can be.

Thanks again,
Nicolas.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Crash error with Windows Vista / Visual Studio 2008
« Reply #3 on: January 31, 2010, 07:12:40 pm »
What is the error message? Can you show us the callstack?
Laurent Gomila - SFML developer

ncarrasco

  • Newbie
  • *
  • Posts: 9
    • View Profile
Crash error with Windows Vista / Visual Studio 2008
« Reply #4 on: January 31, 2010, 07:43:19 pm »
Hi,

Is says:

Unhandled exception at 0x045e1300 in Game.exe: 0xC0000005: Access violation.

The call stack is:

   045e1300()   
    atioglxx.dll!690d80e2()    
    [Frames below may be incorrect and/or missing, no symbols loaded for atioglxx.dll]   
    atioglxx.dll!6908d2b5()    
    atioglxx.dll!6908d165()    
    atioglxx.dll!6908227c()    
    atioglxx.dll!6907b0ff()    
    atioglxx.dll!6907b055()    
    atioglxx.dll!6907b18f()    
    Game.exe!sf::RenderTarget::Clear()  + 0x17a bytes   
    0024f90c()   
    kernel32.dll!76344911()    
    ntdll.dll!77c8e4b6()    
    ntdll.dll!77c8e489()    

Please let me know if you need more information.

Nicolas.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Crash error with Windows Vista / Visual Studio 2008
« Reply #5 on: January 31, 2010, 08:27:16 pm »
Are you in debug mode?
Laurent Gomila - SFML developer

ncarrasco

  • Newbie
  • *
  • Posts: 9
    • View Profile
Crash error with Windows Vista / Visual Studio 2008
« Reply #6 on: February 01, 2010, 01:32:44 am »
Yes.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Crash error with Windows Vista / Visual Studio 2008
« Reply #7 on: February 01, 2010, 08:03:58 am »
Are your drivers up-to-date?
Laurent Gomila - SFML developer

ncarrasco

  • Newbie
  • *
  • Posts: 9
    • View Profile
Crash error with Windows Vista / Visual Studio 2008
« Reply #8 on: February 01, 2010, 11:44:58 pm »
Hi Laurent,

I am not very sure I have the latest ATI drivers. Independently of that I found very strange the error, I run a lot of software at my computer without that crashes.

Do you think that it can be a Driver issue?

Thanks in advance,
Nicolas.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Crash error with Windows Vista / Visual Studio 2008
« Reply #9 on: February 01, 2010, 11:50:10 pm »
Have you tried to run the precompiled samples from the SFML SDK?
Laurent Gomila - SFML developer

ncarrasco

  • Newbie
  • *
  • Posts: 9
    • View Profile
Crash error with Windows Vista / Visual Studio 2008
« Reply #10 on: February 02, 2010, 12:11:54 am »
Hi,

Now I tried running the precompiled samples and work fine :).
Do you think I should recompile the libraries with my Visual 2008 version?

Thanks in advance!
Nicolas.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Crash error with Windows Vista / Visual Studio 2008
« Reply #11 on: February 02, 2010, 07:39:20 am »
Ok, now you can try to recompile those samples and test them again. :)
Laurent Gomila - SFML developer

WitchD0ctor

  • Full Member
  • ***
  • Posts: 100
    • View Profile
    • http://www.teleforce-blogspot.com
Crash error with Windows Vista / Visual Studio 2008
« Reply #12 on: February 08, 2010, 09:02:06 am »
Im having the Exact same problems on my laptop that is running Vista, same exact code runs on my XP Desktop fine, was the issue ever found?
John Carmack can Divide by zer0.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Crash error with Windows Vista / Visual Studio 2008
« Reply #13 on: February 08, 2010, 09:17:59 am »
No, I'm still waiting for the results of compiling and testing again the samples.
Laurent Gomila - SFML developer

panithadrum

  • Sr. Member
  • ****
  • Posts: 304
    • View Profile
    • Skyrpex@Github
    • Email
Crash error with Windows Vista / Visual Studio 2008
« Reply #14 on: February 08, 2010, 10:31:56 am »
When something crash with my Visual Studio projects and SFML is because I update from SVN and dont compile the dlls or libs.

 

anything