Created
June 23, 2014 17:06
-
-
Save nocd5/f4ddc3770374b3d75646 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/mruby.go b/mruby.go | |
index b06ee72..f685393 100644 | |
--- a/mruby.go | |
+++ b/mruby.go | |
@@ -20,8 +20,7 @@ static int _mrb_fixnum(mrb_value o) { return (int) mrb_fixnum(o); } | |
static float _mrb_float(mrb_value o) { return (float) mrb_float(o); } | |
#cgo CFLAGS: -Imruby/include | |
-#cgo LDFLAGS: -L mruby/build/host/lib -lmruby -lm | |
-#cgo windows LDFLAGS: ./libmruby.dll.a | |
+#cgo windows LDFLAGS: -L mruby/build/host/lib/shared -lmruby | |
*/ | |
import "C" | |
import "unsafe" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
事前準備
exportされてない関数が多数あるのでその都度mruby-dll/create_def.rbあたりを使って作るのがベターかな?
-#cgo LDFLAGS: -L mruby/build/host/lib -lmruby -lm
消さないと、こっち優先されてスタティックリンクしようとするみたい。
./libmruby.dll.a
としてリンクするとちゃんとダイナミックリンクされないようなので、-L(ライブラリパス) -lmruby
とする。ちなみにダイナミックリンクの場合は-lmrubyでlibmruby.aもlibmruby.dll.aも両方さがすので名前はどっちでもOK