Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: .exe not running on other computers  (Read 3131 times)

0 Members and 1 Guest are viewing this topic.

The Illusionist Mirage

  • Full Member
  • ***
  • Posts: 115
  • My Life = Linux, C++ & Computers
    • View Profile
    • fleptic
    • Email
.exe not running on other computers
« 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.
« Last Edit: September 03, 2013, 05:36:44 am by The illusionist mirage »

Ixrec

  • Hero Member
  • *****
  • Posts: 1241
    • View Profile
    • Email
Re: .exe not running on other computers
« Reply #1 on: September 03, 2013, 06:32:55 am »
Do the other computers have the audio dlls? (libdnsfile and openal, forgot the exact names)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: .exe not running on other computers
« Reply #2 on: September 03, 2013, 07:44:10 am »
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).
Laurent Gomila - SFML developer

The Illusionist Mirage

  • Full Member
  • ***
  • Posts: 115
  • My Life = Linux, C++ & Computers
    • View Profile
    • fleptic
    • Email
Re: .exe not running on other computers
« Reply #3 on: September 03, 2013, 04:17:03 pm »
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.

 

anything