Lazarus

Free Pascal => General => Topic started by: billyb123 on November 21, 2017, 06:21:53 pm

Title: [solved]my slackware sdl2 fpc game not running in ubuntu
Post by: billyb123 on November 21, 2017, 06:21:53 pm
i compiled it in slackware => works like a charm
i compiled it in windows => works like a charm

then i installed sdl2 libs in ubuntu, tried running the game, no go, tried recompiling in ubuntu, still no go
Code: [Select]
An unhandled exception occurred at $00007FD811367634:
EDivByZero: Division by zero
  $00007FD811367634

of course, there is no divison by zero in my code, must be some lib or something
backtrace from gdb says
Code: [Select]
Program received signal SIGFPE, Arithmetic exception.
0x00007ffff7b7f634 in ?? () from /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0
(gdb) bt
#0  0x00007ffff7b7f634 in ?? () from /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0
#1  0x00007ffff7b8021a in ?? () from /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0
#2  0x00007ffff7b837c6 in ?? () from /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0
#3  0x00007ffff7b75d09 in ?? () from /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0
#4  0x00007ffff7add397 in ?? () from /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0
#5  0x000000000040203a in ?? ()
#6  0x00007fffffff0030 in ?? ()
#7  0x000000000041c159 in ?? ()
#8  0x00007fffffffdd30 in ?? ()
#9  0x0000000000402689 in ?? ()
#10 0x00007fffffffdd40 in ?? ()
#11 0x0000000000405a2e in main ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)

any ideas on what to do?
Title: Re: my slackware sdl2 fpc game not running in ubuntu
Post by: Handoko on November 21, 2017, 06:46:45 pm
Can you share the Linux binary? I'm using Ubuntu Mate 17.10 64-bit, I would like to test it to find out what goes wrong.
Title: Re: my slackware sdl2 fpc game not running in ubuntu
Post by: billyb123 on November 22, 2017, 12:31:13 am
sure thing, i've sent you the binary, check your messages
Title: Re: my slackware sdl2 fpc game not running in ubuntu
Post by: Handoko on November 22, 2017, 03:33:43 am
I managed to make it works on my Ubuntu Mate 17.10.

I just updated my Ubuntu a month ago, so technically it didn't have SDL installed. I checked the binary of your game, I saw 2 libraries were missing:
- libSDL2-2.0.so.0
- libSDL2_image-2.0.so.0

So, using Synaptic Package Manager I installed both libsdl-2.0-0 and libsdl2-image-2.0-0. Problem solved.
Title: Re: my slackware sdl2 fpc game not running in ubuntu
Post by: billyb123 on November 22, 2017, 03:49:33 am
thanks, but i did install those exact libs on ubuntu before starting it.. maybe its something to do with ubuntu version.. 16.04 in my case..
Title: Re: my slackware sdl2 fpc game not running in ubuntu
Post by: Handoko on November 22, 2017, 03:58:47 am
Is your Ubuntu 32-bit or 64-bit? Mine is 64-bit.

Have you checked missing libraries by using ldd command in your terminal?
Code: Pascal  [Select][+][-]
  1. ldd dagoban
Title: Re: my slackware sdl2 fpc game not running in ubuntu
Post by: marcov on November 22, 2017, 03:25:12 pm
Try putting this somewhere near the top of you main program:

Code: Pascal  [Select][+][-]
  1. var
  2.   FPUExceptionMask: TFPUExceptionMask;
  3. ..
  4. begin
  5.   FPUExceptionMask := GetExceptionMask;
  6.   SetExceptionMask(FPUExceptionMask + [exZeroDivide]);
  7. ...
  8.  
Title: Re: my slackware sdl2 fpc game not running in ubuntu
Post by: billyb123 on November 24, 2017, 01:23:20 pm
@marcov - still crashed..
but i reinstalled ubuntu on another machine for giggles.. it now works..
ill mark it solved.. thanks for the replies
TinyPortal © 2005-2018