0 Members and 2 Guests are viewing this topic.
#include <SFML/Graphics.hpp>int main(){ sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!"); sf::CircleShape shape(100.f); shape.setFillColor(sf::Color::Green); while (window.isOpen()) { sf::Event event; while (window.pollEvent(event)) { if (event.type == sf::Event::Closed) window.close(); } window.clear(); window.draw(shape); window.display(); } return 0;}
added 'SFML_DYNAMIC' to the #defines section.
(the last link in the windows section: http://www.sfml-dev.org/download/sfml/2.1/)
Quote from: ifconfused on July 30, 2013, 12:33:29 amadded 'SFML_DYNAMIC' to the #defines section. Did you read the Tutorial carefully? Because you only need to define SFML_STATIC for static linking, but you never need to define SFML_DYNAMIC...Quote(the last link in the windows section: http://www.sfml-dev.org/download/sfml/2.1/)Wich version have you downloaded? "GCC 4.7 MinGW (DW2) - 32 bits" or "GCC 4.7 TDM (SJLJ) - 64 bits". Both are the last links of their column.AlexAUT
The codeblocks-12.11mingw-setup.exe file includes the GCC compiler and GDB debugger from TDM-GCC (version 4.7.1, 32 bit).
Quote The codeblocks-12.11mingw-setup.exe file includes the GCC compiler and GDB debugger from TDM-GCC (version 4.7.1, 32 bit).You have the wrong sfml package."GCC 4.7 TDM (SJLJ) - 32 bits" should be the right package... AlexAUT
Child process PID: 7020Program received signal SIGSEGV, Segmentation fault.In std::basic_string<unsigned int, std::char_traits<unsigned int>, std::allocator<unsigned int> >::_Alloc_hider::_Alloc_hider (this=0x2, __dat=0x373364, __a=...) at d:/programmes/mingw-tdm32-4.7/bin/../lib/gcc/mingw32/4.7.1/include/c++/bits/basic_string.h:272 ()
When I installed the new release 2.1 I have the same error. I fix it deleting the SFML 2.0 folder and his DLLs. Check if you have a copy of SFML libraries on Windows/System32 or a reference in Windows environment Path. Now SFML 2.1 works fine in Code::Blocks 12.1.