2

I have a ruby script. I need to access the functions written in c/c++ in my ruby script. Can any one tell me how to access these functions. Thanks in advance.

4 Answers 4

1

Other options are:

Sign up to request clarification or add additional context in comments.

Comments

1

Ryan Davis has created a 'Hello, World!' C extension example for beginners:

https://github.com/zenspider/ruby-c-example

Comments

1

You could also try Rubyinline

Comments

0

You can create a Ruby module that wraps your C/C++ functions using SWIG.

2 Comments

Miguel thanks for support, is there any way without the use of software like SWING.
SWIG is the cleanest solution, but you have a number of other options. You could make an executable from your C functions, then invoke the executable from Ruby via a system() call, for example.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.