YaneuraoGameSDK.NETをMacで その2
こないだぼそっとつぶやいてみたら、id:yaneurao様がYaneSDK.NET 1.01にバイナリをつけてくださった。
ありがとうございます>やねうらお様
そこで、再びチャレンジ。
まずはYanesdk.dllをコピって実行。っと。MacのSDL入れてなかったのでインストール。
さて実行。
KENZ$ mono nyoki2.exe Unhandled Exception: System.DllNotFoundException: lib\SDL in (wrapper managed-to-native) Sdl.SDL:SDL_InitSubSystem (uint) in <0x00017> Yanesdk.Draw.SDLWindow:.ctor () in <0x00054> Nyoki2.GameInfo:.ctor (System.String args) in <0x00029> Nyoki2.Program:Main (System.String args)
うまくいかない。いろいろ試してみたところどうやらDllImportでlib\SDL.dllというパスが埋め込まれてるようなのでパス区切り文字の違いから、lib\SDL.soという(パスではなく)ファイル名を探しにいくみたい。そこで荒っぽく:
KENZ$ cp /Library/Frameworks/SDL.Framework/SDL lib\\SDL.so
今度はどーだ!
(※ちなみに、こーゆーDLL名の問題はたぶんDllMap使うのが正解だと思います。)
KENZ$ mono nyoki2.exe Unhandled Exception: System.DllNotFoundException: lib\SDL in (wrapper managed-to-native) Sdl.SDL:SDL_InitSubSystem (uint) in <0x00017> Yanesdk.Draw.SDLWindow:.ctor () in <0x00054> Nyoki2.GameInfo:.ctor (System.String args) in <0x00029> Nyoki2.Program:Main (System.String args)
だめぽ。以下のページに書いてある方法でMONO_LOG_LEVEL=debugを指定して詳しく調べてみたところ
http://www.mono-project.com/DllNotFoundException
(./nyoki2.exe:304): Mono-WARNING **: DllImport unable to load library 'dlopen(lib\SDL.so, 9): no suitable image found. Did find: lib\SDL.so: mach-o, but wrong architecture'. Mono-INFO: DllImport attempting to load: 'lib\SDL'. Mono-INFO: DllImport loading location: 'lib\SDL'. Mono-INFO: DllImport error loading library: 'dlopen(lib\SDL.so, 9): no suitable image found. Did find: lib\SDL.so: mach-o, but wrong architecture'. Mono-INFO: DllImport loading library: './lib\SDL'. Mono-INFO: DllImport error loading library 'dlopen(./lib\SDL.so, 9): no suitable image found. Did find: ./lib\SDL.so: mach-o, but wrong architecture'. Mono-INFO: DllImport loading: 'lib\SDL'. Mono-INFO: DllImport error loading library 'dlopen(lib\SDL.so, 9): no suitable image found. Did find: lib\SDL.so: mach-o, but wrong architecture'.
mach-oだけどアーキテクチャがちが…?…Intel Core Soloだからか…!
とゆーわけで、Mac MonoのP/InvokeはまだIntel Macに対応していないとみた。
しばらく様子見ですな。(G4 Mac、人に売るんじゃなかった…)