SFML community forums
Help => General => Topic started by: The Illusionist Mirage on September 03, 2013, 05:23:11 am
-
Hello
I made a game in sfml 2.0 using codeblocks and mingw 4.7.2. It runs fine in my computer but when I run it on other computers, it doesn't run. also, if I debug it on other computers, i get these:
#0 004565B6 sf::SoundBuffer::SoundBuffer(this=0x402b01) (C:\SFML-2.1\src\SFML\Audio\SoundBuffer.cpp:42)
#1 00402BBA __static_initialization_and_destruction_0(__initialize_p=1, __priority=65535) (D:\CodeBlocks\SFML 2.0\Games\Pong_Final\main.cpp:41)
#2 00402C16 _GLOBAL__sub_I_WINDOW_CAPTION() (D:\CodeBlocks\SFML 2.0\Games\Pong_Final\main.cpp:219)
#3 0046225F __do_global_ctors() (../mingw/gccmain.c:59)
#4 00401098 __mingw_CRTStartup() (../mingw/crt1.c:236)
#5 00401284 mainCRTStartup() (../mingw/crt1.c:264)
Also I get this message:
Program recieved SIGSEGV, segmentation fault.
Can anyone explain what's the problem?
Thanks
EDIT:
I just realized that if I recompile my code in another computer and then run .exe, it runs correctly. But without recompiling, it doesn't run.
-
Do the other computers have the audio dlls? (libdnsfile and openal, forgot the exact names)
-
Don't construct SFML objects at global scope, especially resources. SFML has its own global objects, and these might not be initialized before yours (order is undefined and may change from one computer/compiler to another).
-
Do the other computers have the audio dlls? (libdnsfile and openal, forgot the exact names)
Yes, I copied the entire project folder to the other computer(including, images, fonts, dlls and project file). I have linked everything statically.
Don't construct SFML objects at global scope, especially resources. SFML has its own global objects, and these might not be initialized before yours (order is undefined and may change from one computer/compiler to another).
All I did is define some some classes(like game manger class, button class, etc.). As soon as I finish minimum and complete code, that can to be seen to point out flaws, I'll post it here.