Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

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

Open
zedalaye opened this Issue Aug 29, 2012 · 14 comments

Comments

Projects
None yet
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.

syalon commented Sep 19, 2012

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

Contributor

masuidrive commented Jan 5, 2013

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?

Contributor

mattn commented Jan 6, 2013

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

Contributor

kurodash commented Mar 25, 2013

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.

Contributor

kurodash commented Mar 26, 2013

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.

Contributor

mattn commented Mar 26, 2013

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

Contributor

kurodash commented Mar 26, 2013

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

Contributor

mattn commented Mar 26, 2013

Was this issue subject solved...?

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

Contributor

cremno commented Mar 26, 2013

What functions (or data) do you mean?

Contributor

mattn commented Mar 26, 2013

functions that have prefix static inline.

Contributor

cremno commented Mar 26, 2013

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

Contributor

mattn commented Mar 26, 2013

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

Contributor

perlun commented Nov 16, 2013

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.

Contributor

take-cheeze commented Feb 26, 2014

mattn/mruby-dll#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