简体   繁体   English

将Ruby嵌入C ++中,Ruby库有问题

[英]Embedding ruby in c++, problem with ruby libraries

I want to have a ruby interpreter in my c++ application. 我想在我的C ++应用程序中使用ruby解释器。 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. 我找到了一篇有关它的文章: http : //aeditor.rubyforge.org/ruby_cplusplus/index.html但是这里他们使用了makefile来编译程序,因此我对此并不十分熟悉,因此无法正确修改。 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. 我还在这里找到了一个非常简单的示例: http : //my.opera.com/subjam/blog/embedding-ruby-in-c-programs但是我又遇到了编译问题。 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. 他们说您需要输入g ++ -o ruby​​_test1 ruby​​_test1.c -I / usr / lib / ruby​​ / 1.8 / i486-linux / -lruby1.8这对我来说很有意义,但是我没有“ i486-linux” ”位于我的ruby目录中。 I installed it via apt-get and I chose the '-dev' version. 我通过apt-get安装了它,然后选择了'-dev'版本。

Where can I find the needed file? 在哪里可以找到所需的文件?

PS I'm using Ubuntu. PS我正在使用Ubuntu。 If I like this interpreter I'll also want to make it work on Windows, so any help will, be appreciated. 如果我喜欢这个解释器,我也想使其在Windows上运行,因此,我们将不胜感激。

I'm not interested in some substitutes for ruby, like tinyrb or whatever. 我对红宝石的一些替代品不感兴趣,例如tinyrb或其他任何替代品。

Bye 再见

You probably don't have an i486 architecture. 您可能没有i486架构。 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. 对我来说,它是“ x86_64-linux”,运行arch命令来查看您拥有的体系结构,然后将其放在“ -linux”的最前面,然后查看它是否在那里。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM