Skip to content


Subversion checkout URL

You can clone with
Download ZIP


How to build mruby.dll with Visual Studio ? #443

zedalaye opened this Issue · 14 comments

8 participants


I used cmake to generate Visual Studio 2010 Solutions Files then I built the solution inside VS but the only artifacts I get are mirb.exe, mruby.exe, mrbc.exe, mrbtest.exe, xpcat.exe and ... mruby.lib

How can I build an mruby .dll ?

Thank you very much.


change the project setting 'lib' to 'dll' , ~ but any CAPI is not exported...


I changed build script.
But I don't know how to build 'dll' file using Visual studio.

Could you tell me how to build dll on command line?


mruby's codes are defined functions as static inline. So it can't export to external.


to build DLL, sets /DLL option for LINK.exe.

C:> link.exe /DLL /nologo /OUT:".\build\host\lib\libmruby.dll" ".\build\host\src\array.obj" ".\build\host\src\class.obj" ...

But It cant export static inline function, as mattn has already told.


Please let me make corrections.

A library is exporting the public functions for linkage theoretically. DLL is also the same. :)
So, I think that building DLL is possible.
I'll try it.


If you want to build mruby.dll, you can use
But some symbols are not exported yet.


mattun san
Thank you for information.
Was this issue subject solved...?


Was this issue subject solved...?

No, I think mruby should export all of APIs (if we want). But currently, this seems low priority.


What functions (or data) do you mean?


functions that have prefix static inline.


And why do you want to export them? These functions should be inlined and not called because this would decrease performance.


There are many functions that is useful to manipulate mrb_value.

  • mrb_float_value
  • mrb_symbol_value
  • mrb_obj_value
  • mrb_intern

  • etc...

Those functions are defined as static inline


See also this project: I think we should try and integrate this functionality in what gets built by default, since it's quite useful.


With this pull request now by including mruby-dll mrbgem it can generate shared library or dylib too.
Though I don't know whether Visual Studio linker provides a option like -force_load or --whole-archive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.