3 Replies - 2748 Views - Last Post: 10 December 2012 - 05:10 PM Rate Topic: -----

#1 umerm  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 11-November 12

Errors in SFML

Posted 09 December 2012 - 02:13 AM

Hi I have setup SFML 2.0 on Codeblock 12.11 version I am facing the following problem please help.the code doesn't run
#include <SFML/window.hpp>

int main()
{
    sf::Window window(sf::VideoMode(800, 600), "My window");

    // run the program as long as the window is open
    while (window.isOpen())
    {
        // check all the window's events that were triggered since the last iteration of the loop
        sf::Event event;
        while (window.pollEvent(event))
        {
            // "close requested" event: we close the window
            if (event.type == sf::Event::Closed)
                window.close();
        }
    }

    return 0;
}



It gives these error i dont know what to do and i have installed sfml for the first time.

||=== xxx, Debug ===|
obj\Debug\main.o||In function `main':|
C:\Users\Umer\Desktop\Projects Plus Plus\xxx\main.cpp|4|undefined reference to `__gxx_personality_sj0'|
C:\Users\Umer\Desktop\Projects Plus Plus\xxx\main.cpp|4|undefined reference to `_Unwind_SjLj_Register'|
C:\Users\Umer\Desktop\Projects Plus Plus\xxx\main.cpp|5|undefined reference to `_Unwind_SjLj_Resume'|
C:\Users\Umer\Desktop\Projects Plus Plus\xxx\main.cpp|20|undefined reference to `_Unwind_SjLj_Unregister'|
C:\Users\Umer\Desktop\Projects Plus Plus\xxx\main.cpp|20|undefined reference to `_Unwind_SjLj_Resume'|
||=== Build finished: 5 errors, 0 warnings (0 minutes, 1 seconds) ===|

Is This A Good Question/Topic? 0
  • +

Replies To: Errors in SFML

#2 anonymous26  Icon User is offline

  • D.I.C Lover

Reputation: 0
  • View blog
  • Posts: 3,638
  • Joined: 26-November 10

Re: Errors in SFML

Posted 09 December 2012 - 12:36 PM

You likely have not included the static libraries. Refer to how to set up SFML.
Was This Post Helpful? 0
  • +
  • -

#3 Serapth  Icon User is offline

  • D.I.C Head

Reputation: 53
  • View blog
  • Posts: 153
  • Joined: 17-August 11

Re: Errors in SFML

Posted 10 December 2012 - 02:59 PM

View PostButchDean, on 09 December 2012 - 07:36 PM, said:

You likely have not included the static libraries. Refer to how to set up SFML.


Nope, those errors are due to the wrong exception handling libraries being linked. SFML switched compile modes a while back and as a result, you need a newer version of the compiler.

The MingW (gcc) version that ships bundled with Codeblocks isn't compatible with SFML2. Download and install the newest version of MingW and configure codeblocks to use it and you are good to go. You can get details here.
Was This Post Helpful? 0
  • +
  • -

#4 anonymous26  Icon User is offline

  • D.I.C Lover

Reputation: 0
  • View blog
  • Posts: 3,638
  • Joined: 26-November 10

Re: Errors in SFML

Posted 10 December 2012 - 05:10 PM

You're right, I wouldn't know because I write my own stuff. :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1