Bonsoir,
J'ai pas mal cherché mais je ne trouve vraiment pas d'où le problème vient.
J'ai "compilé" (cmake) sfml sur un windows 32b en virtualbox afin de tester mon jeu. La compilation (mode debug) fonctionne, l'éxécutable est généré, j'y ajoute toutes les DLL nécessaire mais... au lancement le jeu crash.
Le débugueur ne donne aucun message d'erreur utile, a part la stck trace : ça plante dans sf::RenderTarget::clear() sur le if(activate(true))
Unhandled exception: page fault on read access to 0x0000040c in 32-bit code (0x68ed26b6).
Register dump:
CS:0023 SS:002b DS:002b ES:002b FS:0063 GS:006b
EIP:68ed26b6 ESP:00c6f990 EBP:00c6f9b8 EFLAGS:00210206( R- -- I - -P- )
EAX:0000040c EBX:7b8b0000 ECX:00000000 EDX:00c6fa70
ESI:7ffd8000 EDI:00000000
Stack dump:
0x00c6f990: 00000000 00000000 00000022 00000000
0x00c6f9a0: 00000022 000000ff 00000000 00000000
0x00c6f9b0: 00c6f900 7b8b0000 00c6f9f8 00401c32
0x00c6f9c0: 00c6fa70 00c6f9ec 00000000 00000000
0x00c6f9d0: 000000ff 66082449 00c6f9e0 660825bf
0x00c6f9e0: 0000411a 00000000 00000022 ff000000
Backtrace:
=>0 0x68ed26b6 RenderTarget::clear+0xe(this=0xc6fa70, color=0xc6f9ec) [C:\SFML-2.0\cmake-build\src\SFML\Graphics/C:/SFML-2.0/src/SFML/Graphics/RenderTarget.cpp:58] in sfml-graphics-d-2 (0x00c6f9b8)
1 0x00401c32 Application::render+0x49(this=0xc6fa50) [C:\Users\Merlin\Programmation\book/application.cpp:83] in book (0x00c6f9f8)
2 0x00401b4f Application::run+0x114(this=0xc6fa50) [C:\Users\Merlin\Programmation\book/application.cpp:61] in book (0x00c6fa38)
3 0x0040141f main+0x2a() [C:\Users\Merlin\Programmation\book/main.cpp:10] in book (0x00c6fdd8)
Le jeu tourne sur mon linux. J'ai essayé le lancement sur 3 machines différentes sous windows (dont une seule en virtual host)
Les exemples fonctionnent, mais j'ai le même problème avec le code minimal :
#include <SFML/Audio.hpp>
#include <SFML/Graphics.hpp>
int main()
{
// Create the main window
sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window");
// Load a sprite to display
sf::Texture texture;
if (!texture.loadFromFile("image.jpg"))
return EXIT_FAILURE;
sf::Sprite sprite(texture);
// Start the game loop
while (window.isOpen())
{
// Process events
sf::Event event;
while (window.pollEvent(event))
{
// Close window : exit
if (event.type == sf::Event::Closed)
window.close();
}
// Clear screen
window.clear();
// Draw the sprite
window.draw(sprite);
// Update the window
window.display();
}
return EXIT_SUCCESS;
}
Je sais pas si ça peut aider mais voilà ce qui est exécuté :
g++ -c -pipe -std=c++0x -g -frtti -fexceptions -mthreads -Wall -Wextra -DUNICODE -I"..\..\..\..\Qt\4.8.5\mkspecs\win32-g++" -o debug\main.o main.cpp
g++ -Wl,-subsystem,console -mthreads -o debug\test.exe debug/main.o -lsfml-system-d -lsfml-window-d -lsfml-graphics-d -lsfml-audio-d -lsfml-network-d
J'ai du faire une bêtise à un moment ou à un autre. J'essaierai de tout refaire de zéro...
Edit: Aaahh j'ai peut-être une idée,j'ai mis à jour MinGW pour la vrsion c++11 en écrasant la précédente (bouuuh). Avec une installation propre ça sera déjà peut-être mieux