Mac OS X 10.7上的Derelict2:SDL无法构建

时间:2012-05-15 06:16:34

标签: macos makefile osx-lion d

我正在尝试按照包含的Derelict2在Lion上构建installation instructions。当我运行命令make -fmac.mak DC=dmd时,以下库构建正常:

  • DerelictAllegro
  • DerelictFMOD
  • DerelictFT
  • DerelictGL
  • DerelictIL
  • DerelictODE
  • DerelictOgg
  • DerelictPA

不幸的是,一旦脚本升级到DerelictSDL,就会吐出以下内容:

make -C DerelictSDL all PLATFORM=mac
dmd -release -O -inline -I../DerelictUtil -c derelict/sdl/sdl.d derelict/sdl/sdlfuncs.d derelict/sdl/sdltypes.d -Hd../import/derelict/sdl
dmd -release -O -inline -I../DerelictUtil -c derelict/sdl/macinit/CoreFoundation.d derelict/sdl/macinit/DerelictSDLMacLoader.d derelict/sdl/macinit/ID.d derelict/sdl/macinit/MacTypes.d derelict/sdl/macinit/NSApplication.d derelict/sdl/macinit/NSArray.d derelict/sdl/macinit/NSAutoreleasePool.d derelict/sdl/macinit/NSDictionary.d derelict/sdl/macinit/NSEnumerator.d derelict/sdl/macinit/NSEvent.d derelict/sdl/macinit/NSGeometry.d derelict/sdl/macinit/NSMenu.d derelict/sdl/macinit/NSMenuItem.d derelict/sdl/macinit/NSNotification.d derelict/sdl/macinit/NSObject.d derelict/sdl/macinit/NSProcessInfo.d derelict/sdl/macinit/NSString.d derelict/sdl/macinit/NSZone.d derelict/sdl/macinit/runtime.d derelict/sdl/macinit/SDLMain.d derelict/sdl/macinit/selectors.d derelict/sdl/macinit/string.d     -Hd../import/derelict/sdl/macinit
derelict/sdl/macinit/NSString.d(134): Error: cannot implicitly convert expression (this.length()) of type ulong to uint
derelict/sdl/macinit/NSString.d(135): Error: cannot implicitly convert expression (str.length()) of type ulong to uint
derelict/sdl/macinit/NSString.d(140): Error: cannot implicitly convert expression (cast(ulong)(selfLen + aStringLen) - aRange.length) of type ulong to uint
make[1]: *** [dmd_mac_build_sdl] Error 1
make: *** [DerelictSDL_ALL] Error 2

2 个答案:

答案 0 :(得分:1)

Derelict的最新版本为Derelict3, which is on GitHub

至于你的错误,看起来你正在为64位编译,这显然在Derelict2中没有被考虑。

您只需修复源代码即可。执行此操作的正确方法是将这些实例更改为使用size_t而不是uint,但在错误消失之前,cast(size_t)这些表达式可能更容易:-)它是不太可能长度超过40亿,所以你应该没事,直到你切换到Derelict3。

答案 1 :(得分:0)

尝试以32位模式编译。我相信它是dmd和gdc / gdmd

的-m32选项