嵌入ruby在c ++,ruby库的问题 [英] Embedding ruby in c++, problem with ruby libraries

查看:202
本文介绍了嵌入ruby在c ++,ruby库的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的c ++应用程序中有一个ruby解释器。我找到了一篇关于它的文章:
http://aeditor.rubyforge.org/ruby_cplusplus/ index.html
但是在这里他们使用makefile来编译程序,我不是很熟悉这个,因此我不能正确地修改它。
我也发现了一个很简单的例子:
http://my.opera.com/subjam/blog/embedding-ruby-in-c-programs
但是我又遇到了一个编译问题。
他们说你需要输入
g ++ -o ruby​​_test1 ruby​​_test1.c -I / usr / lib / ruby​​ / 1.8 / i486-linux / -lruby1.8
这对我有意义,但我没有在我的ruby目录中的i486-linux文件夹。我通过apt-get安装它,我选择了'-dev'版本。

I want to have a ruby interpreter in my c++ application. I found an article about it: http://aeditor.rubyforge.org/ruby_cplusplus/index.html But here they use a makefile to compile the program, and I'm not really familiar with this consequently I can't modify it properly. I also found a really simple example here: http://my.opera.com/subjam/blog/embedding-ruby-in-c-programs But again I encounter a compilation problem. They say you need to type g++ -o ruby_test1 ruby_test1.c -I/usr/lib/ruby/1.8/i486-linux/ -lruby1.8 And this makes sense to me, but I don't have the "i486-linux" folder in my ruby directory. I installed it via apt-get and I chose the '-dev' version.

在哪里可以找到所需的文件?

Where can I find the needed file?

PS
我使用Ubuntu。如果我喜欢这个解释器,我也想让它在Windows上工作,所以
任何帮助,将不胜感激。

PS I'm using Ubuntu. If I like this interpreter I'll also want to make it work on Windows, so any help will, be appreciated.

我对ruby的一些替代品不感兴趣,像tinyrb或其他。

I'm not interested in some substitutes for ruby, like tinyrb or whatever.

再见

推荐答案

您可能没有i486架构。像我这样的x86_64-linux运行 arch 命令来查看你有什么架构,然后把-linux的面前,看看它是否存在。

You probably don't have an i486 architecture. like for me it's "x86_64-linux" run the arch command to see what architecture you have and then put that infront of "-linux" and see if it that is there.

这篇关于嵌入ruby在c ++,ruby库的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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