I have been reading through posts and trying to figure out how to get SFML to work properly on my machine.
I am running 32bit Windows Vista , and using Codeblocks.
The first problem that I'm having is getting the pong demo from the samples in the SDK to run.
I have added SFML_DYNAMIC to my #defines.
In my Other Linker Options I have:
-lsfml-graphics-d
-lsfml-window-d
-lsfml-audio-d
-lsfml-system-d
I have gone through the tutorial to set up SFML on codeblocks many times now and I cannot figure out why I keep getting this problem:
-------------- Build: Debug in pong ---------------
Linking console executable: bin\Debug\pong.exe
Info: resolving sf::Font::ourDefaultCharset by linking to __imp___ZN2sf4Font17ourDefaultCharsetE (auto-import)
Info: resolving vtable for sf::Stringby linking to __imp___ZTVN2sf6StringE (auto-import)
Info: resolving vtable for sf::Spriteby linking to __imp___ZTVN2sf6SpriteE (auto-import)
obj\Debug\pong.o(.text$_ZN2sf6StringD1Ev[sf::String::~String()]+0x3a): In function `ZNSt8_Rb_treeIPN2sf11ResourcePtrINS0_5ImageEEES4_St9_IdentityIS4_ESt4lessIS4_ESaIS4_EE11_M_put_nodeEPSt13_Rb_tree_nodeIS4_E':
C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_construct.h: variable 'vtable for sf::String' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details.
obj\Debug\pong.o(.text$_ZN2sf6SpriteD1Ev[sf::Sprite::~Sprite()]+0x3a):C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_construct.h: variable 'vtable for sf::Sprite' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details.
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings
The second problem that I am having is that every time I run part of the windowing tutorial, it builds and executes but the program hangs and then stops responding every time. The console window and the SFML window pop up, and the SFML window initially has a black background but after a few seconds it turns all white and thats when the not responding message pops up. Here is the code that I have:
#include <SFML/Window.hpp>
int main()
{
sf::Window App(sf::VideoMode(800, 600, 32), "SFML Window");
bool Running = true;
sf::Event Event;
while (App.GetEvent(Event))
{
// Window closed
if (Event.Type == sf::Event::Closed)
Running = false;
// Escape key pressed
if ((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::Escape))
Running = false;
}
while (Running)
{
App.Display();
}
return 0;
}
I started the project as a console application, using the GNU gcc compiler.
I have set SFML_DYNAMIC in my compiler defines.
In my Other Linker Options I have:
-lsfml-window-d
-lsfml-system-d
I copied all of the lib/mingw files and the /include files to the codeblocks directories.
I'm not sure what i'm doing wrong at this point. I am going to play with it some more when I get a chance. I am very interested in developing with SFML , and if anyone could lend me some advice it would be greatly appreciated!