Getting SDL working on MacOS X

Anders F Björklund afb at algonet.se
Sun Mar 12 00:07:07 PST 2006


Ryan Burton wrote:

>>Looks good, so must be something new in the Tiger linker I guess ?
>>
>>If you're bored, you can use the GCC-3.3 based version meanwhile...
>>(at least I hope that you can, as it seemed to work OK for Panther)
> 
> Hmmm... I just tried the Panther GDC binaries and got the same error. I 
> suppose I'll be building on Windows for now.

Thanks for testing, but it was an error in my SDL wrapper (sorry) :-(

The order of the declarations need to be swapped around, and it works:
diff -u -r1.2 mutex.d
--- sdl/mutex.d 23 Oct 2004 08:16:37 -0000      1.2
+++ sdl/mutex.d 12 Mar 2006 08:06:58 -0000
@@ -48,12 +48,12 @@
  SDL_mutex * SDL_CreateMutex();

  /* Lock the mutex  (Returns 0, or -1 on error) */
-int SDL_LockMutex(SDL_mutex *m) { return SDL_mutexP(m); }
  int SDL_mutexP(SDL_mutex *mutex);
+int SDL_LockMutex(SDL_mutex *m) { return SDL_mutexP(m); }

  /* Unlock the mutex  (Returns 0, or -1 on error) */
-int SDL_UnlockMutex(SDL_mutex* m) { return SDL_mutexV(m); }
  int SDL_mutexV(SDL_mutex *mutex);
+int SDL_UnlockMutex(SDL_mutex* m) { return SDL_mutexV(m); }

  /* Destroy a mutex */
  void SDL_DestroyMutex(SDL_mutex *mutex);


> ld: libSDL_d.a(mutex.o) has external relocation entries in non-writable section (__TEXT,__text) for symbols:
> _SDL_mutexV
> _SDL_mutexP

Fixed in CVS, got "your error" before - and after this change it works.

Thanks!
--anders



More information about the Digitalmars-d mailing list