Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

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

Open
zedalaye opened this Issue · 14 comments

8 participants

@zedalaye

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.

@syalon

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

@masuidrive

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?

@mattn

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

@kurodash

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.

@kurodash

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.

@mattn

If you want to build mruby.dll, you can use https://github.com/mattn/mruby-dll
But some symbols are not exported yet.

@kurodash

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

@mattn

Was this issue subject solved...?

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

@cremno

What functions (or data) do you mean?

@mattn

functions that have prefix static inline.

@cremno

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

@mattn

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

@perlun

See also this project: https://github.com/cremno/mruby-dll. I think we should try and integrate this functionality in what gets built by default, since it's quite useful.

@take-cheeze

mattn/mruby-sharedlib#1
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.