The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
Linking SDL in Linux
mercior


Joined: 14 Jan 2010
Posts: 2
Location: UK
I am writing a dynamic library which relies on SDL and is linked to libGL, libGLU and linked to SDL via `sdl-config --libs --cflags`. My library is named libMGE.

I'm compiling a simple test program that relies on my library, and is linked to my libMGE library.

When I execute the test program, the SDL window appears but doesn't respond until i attempt to close the program with a ctrl+c (SIGTERM) -- then suddenly it jumps to life! It continues to work normally after this, and another ctrl+c closes it.

The code is cross platform and my windows implementation is working fine, so I think its relating to how im compiling or linking the library.. is there some gcc equivelant to the "multi threaded library" option i use in visual studio when compiling against SDL? Or what else could I have done wrong?
Linking SDL in Linux
mattmatteh
Guest

post a link to the source ?

matt

On Thu, 14 Jan 2010, mercior wrote:

Quote:
I am writing a dynamic library which relies on SDL and is linked to libGL, libGLU and linked to SDL via `sdl-config --libs --cflags`. My library is named libMGE.

I'm compiling a simple test program that relies on my library, and is linked to my libMGE library.

When I execute the test program, the SDL window appears but doesn't respond until i attempt to close the program with a ctrl+c (SIGTERM) -- then suddenly it jumps to life! It continues to work normally after this, and another ctrl+c closes it.

The code is cross platform and my windows implementation is working fine, so I think its relating to how im compiling or linking the library.. is there some gcc equivelant to the "multi threaded library" option i use in visual studio when compiling against SDL? Or what else could I have done wrong?





_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Linking SDL in Linux
Donny Viszneki
Guest

Send us the output of strace.

Run your program with the same command you usually do, but prepend the
command with "strace"

An easy way to redirect the output to a file is with &> filename
appended to the command.

So for the command "./mygame 1 2 3" use this command:

strace ./mygame 1 2 3 &> log

Then send us the "log" file.

This might make the problem clear without the need for us inspecting
your entire source code Smile

On Thu, Jan 14, 2010 at 11:52 AM, mercior wrote:
Quote:
I am writing a dynamic library which relies on SDL and is linked to libGL,
libGLU and linked to SDL via `sdl-config --libs --cflags`. My library is
named libMGE.

I'm compiling a simple test program that relies on my library, and is linked
to my libMGE library.

When I execute the test program, the SDL window appears but doesn't respond
until i attempt to close the program with a ctrl+c (SIGTERM) -- then
suddenly it jumps to life! It continues to work normally after this, and
another ctrl+c closes it.

The code is cross platform and my windows implementation is working fine, so
I think its relating to how im compiling or linking the library.. is there
some gcc equivelant to the "multi threaded library" option i use in visual
studio when compiling against SDL? Or what else could I have done wrong?
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org





--
http://codebad.com/
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
mercior


Joined: 14 Jan 2010
Posts: 2
Location: UK
I have since solved the issue, which turned out to not be a linking issue at all but rather a misunderstanding between Sleep() and sleep() Sad The hanging was caused by a 3 minute sleep() call. Thanks for offering your help, though!
Linking SDL in Linux
Jonny D


Joined: 12 Sep 2009
Posts: 932
Have you looked into SDL_Delay()?

Jonny D


On Thu, Jan 14, 2010 at 11:25 PM, mercior wrote:
Quote:
I have since solved the issue, which turned out to not be a linking issue at all but rather a misunderstanding between Sleep() and sleep() The hanging was caused by a 3 minute sleep() call. Thanks for offering your help, though!


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org