如何将Ruby嵌入到C ++中? [英] How to embed Ruby in C++?

查看:216
本文介绍了如何将Ruby嵌入到C ++中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在C ++中将Ruby嵌入脚本语言的最好方法是什么?使用ruby.h? SWIG?还有什么?我需要的是将一些C ++对象暴露给Ruby,并让Ruby解释器评估访问这些对象的脚本。我不关心扩展Ruby或在C ++中访问它。



我发现这个关于嵌入Ruby在C ++中的文章,虽然它非常有用,它有点老,我想知道是否有任何其他资源的主题(或类似引擎的开源实现)。

解决方案

swig是可能的方式去.....但是ruby没有嵌入太好......

如果你想要一种嵌入C ++的语言,请尝试lua


What's the best way to embed Ruby as a scripting language in C++? Using ruby.h? SWIG? Something else? What I need is to expose some C++ objects to Ruby and have the Ruby interpreter evaluate scripts that access these objects. I don't care about extending Ruby or accessing it in C++.

I've found this article on embedding Ruby in C++, and while it's very useful, it's kinda old and I was wondering if there are any other resources on the subject (or open source implementations of similar engines).

解决方案

swig is probablly the way to go..... but ruby doesnt embed too well......

if you want a language that embeds nicely into C++, try lua

这篇关于如何将Ruby嵌入到C ++中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆