Dungeon Crawl Stone Soup Tracker - DCSS
Viewing Issue Advanced Details
9069 Bug Report block always 2014-10-22 21:32 2014-11-07 01:06
xaff Local  
sgrunt MacOSX  
normal Tiles  
resolved 0.16 ancient branch  
done  
none    
none 0.16 ancient branch  
0009069: Compilation of Tiles fails with the most recent versions of XCode
Hi,

Compilation of trunk fails on Macs with the latest version of XCode installed. The error message is:
    CC src/events/SDL_events.o
In file included from src/events/SDL_events.c:28:
In file included from src/events/SDL_sysevents.h:24:
In file included from src/events/../video/SDL_sysvideo.h:37:
include/SDL_opengl.h:3124:22: error: typedef redefinition with different types
      ('unsigned int' vs 'void *')
typedef unsigned int GLhandleARB;       /* shader object handle */
                     ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/
System/Library/Frameworks/OpenGL.framework/Headers/gltypes.h:28:18: note:
      previous definition is here
typedef void    *GLhandleARB;
                 ^
1 error generated.
make[2]: *** [src/events/SDL_events.o] Error 1
make[1]: *** [sdl] Error 2
make: *** [.contrib-libs] Error 2


Changing the type in contrib/sdl/include/SDL_opengl.h results in following errors:
    CC src/video/quartz/SDL_QuartzEvents.o
In file included from src/video/quartz/SDL_QuartzEvents.m:24:
src/video/quartz/SDL_QuartzVideo.h:95:5: error: unknown type name 'CGDirectPaletteRef'
    CGDirectPaletteRef palette;            /* palette of an 8-bit display */
    ^
src/video/quartz/SDL_QuartzEvents.m:216:23: warning: 'GetScriptManagerVariable' is
      deprecated: first deprecated in OS X 10.5 [-Wdeprecated-declarations]
    KCHRPtr = (void *)GetScriptManagerVariable(smKCHRCache);
                      ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/
System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Script.h:98
6:1: note:
      'GetScriptManagerVariable' has been explicitly marked deprecated here
GetScriptManagerVariable(short selector)                      __OSX_AVAILABLE_B...
^
src/video/quartz/SDL_QuartzEvents.m:226:21: warning: implicit declaration of function
      'KeyTranslate' is invalid in C99 [-Wimplicit-function-declaration]
            value = KeyTranslate(KCHRPtr, i, &state) & 0xff;
                    ^
src/video/quartz/SDL_QuartzEvents.m:733:5: error: use of undeclared identifier
      'CGMouseDelta'
    CGMouseDelta dx, dy;
(...cut...)
Issue History
2014-10-22 21:32 xaff New Issue
2014-10-22 22:21 Reaver Note Added: 0027540
2014-10-22 22:45 xaff Note Added: 0027541
2014-10-22 22:49 xaff Note Edited: 0027541
2014-11-07 01:06 sgrunt Note Added: 0027681
2014-11-07 01:06 sgrunt Assigned To => sgrunt
2014-11-07 01:06 sgrunt Status new => resolved
2014-11-07 01:06 sgrunt Resolution open => done
2014-11-07 01:06 sgrunt Fixed in Branch => 0.16 development branch

Notes
(0027540)
Reaver   
2014-10-22 22:21   
geekosaur has commented that this can be fixed by replacing Crawl's sdl (submodule) with the 1.2.15 version. (Currently Crawl's is just 1.2.13, with backported fix.) Unfortunately, I have no idea what effects updating the sdl version could have on compilation for other Operating Systems, so changing the sdl version in master would require a lot of testing on different OSes/toolchains (and changing it to 2.x would probably be better if we were going to go through that effort).
(0027541)
xaff   
2014-10-22 22:45   
(edited on: 2014-10-22 22:49)
I have tried doing that, but it seems there's a missing file error during compilation:
    CC src/events/SDL_events.o
In file included from src/events/SDL_events.c:27:
include/SDL_syswm.h:58:10: fatal error: 'X11/Xlib.h' file not found
#include <X11/Xlib.h>
         ^
1 error generated.
make[2]: *** [src/events/SDL_events.o] Error 1
make[1]: *** [sdl] Error 2
make: *** [.contrib-libs] Error 2


Edit: After adding -I/opt/X11/include to CXXFLAGS, I get:
In file included from ./src/video/quartz/SDL_QuartzEvents.m:24:
./src/video/quartz/SDL_QuartzVideo.h:94:5: error: unknown type name
      'CGDirectPaletteRef'
    CGDirectPaletteRef palette;            /* palette of an 8-bit display */
    ^
./src/video/quartz/SDL_QuartzEvents.m:816:13: warning: 'UpdateSystemActivity' is
      deprecated: first deprecated in OS X 10.8 [-Wdeprecated-declarations]
            UpdateSystemActivity(UsrActivity);
            ^
/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/Power.h:36
7:1: note:
      'UpdateSystemActivity' has been explicitly marked deprecated here
UpdateSystemActivity(UInt8 activity)                          __OSX_AVAILABLE_B...
^
1 warning and 1 error generated.


(0027681)
sgrunt   
2014-11-07 01:06   
As of 0.16-a0-1947-gdf9e419, several people have been able to compile OS X tiles correctly with recent versions of XCode.