- Primero me descargo el full SDK de aquí:
http://www.sfml-dev.org/download.php
- Copia las carpetas lib y include a la carpeta de Mingw
- Creo un proyecto en blanco, voy a build options y pongo:
- Introduzco la macro SFML_STATIC tal como sale en el tutorial:
Añado un archivo al proyecto y pongo un código de ejemplo:
Código
#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; }
Clico en compilar, errores:
Citar
c:\mingw\bin\..\lib\gcc\mingw32\4.7.2\..\..\..\libsfml-window-s.a(VideoMode.cpp.obj):VideoMode.cpp|| undefined reference to `__gxx_personality_sj0'|
c:\mingw\bin\..\lib\gcc\mingw32\4.7.2\..\..\..\libsfml-window-s.a(VideoMode.cpp.obj):VideoMode.cpp|| undefined reference to `_Unwind_SjLj_Register'|
c:\mingw\bin\..\lib\gcc\mingw32\4.7.2\..\..\..\libsfml-window-s.a(VideoMode.cpp.obj):VideoMode.cpp|| undefined reference to `_Unwind_SjLj_Unregister'|
c:\mingw\bin\..\lib\gcc\mingw32\4.7.2\..\..\..\libsfml-window-s.a(VideoMode.cpp.obj):VideoMode.cpp|| undefined reference to `_Unwind_SjLj_Resume'|
||=== Build finished: 4 errors, 0 warnings (0 minutes, 0 seconds) ===|
c:\mingw\bin\..\lib\gcc\mingw32\4.7.2\..\..\..\libsfml-window-s.a(VideoMode.cpp.obj):VideoMode.cpp|| undefined reference to `_Unwind_SjLj_Register'|
c:\mingw\bin\..\lib\gcc\mingw32\4.7.2\..\..\..\libsfml-window-s.a(VideoMode.cpp.obj):VideoMode.cpp|| undefined reference to `_Unwind_SjLj_Unregister'|
c:\mingw\bin\..\lib\gcc\mingw32\4.7.2\..\..\..\libsfml-window-s.a(VideoMode.cpp.obj):VideoMode.cpp|| undefined reference to `_Unwind_SjLj_Resume'|
||=== Build finished: 4 errors, 0 warnings (0 minutes, 0 seconds) ===|
Pruebo ahora a enlazar con las librerías dinámicas, elimino la macro STATIC y compilo. Ahora compila correctamente, copio las DLL a la carpeta y ejecuto el programa. Me da error:
Me estoy volviendo loco, LOCO