4 ms·
Can I include a C source file in RubyMotion project, compile it, and call the C functions directly from Ruby? That can be done easily with Obj-C. I was looking
by z92 14y ago
Can I include a C source file in RubyMotion project, compile it, and call the C functions directly from Ruby? That can be done easily with Obj-C.
I was looking for its answer for some time now. Our projects include a lot of C code.
- evilduck 14y agoI'm honestly not sure, I have no experience with Objective-C but just from reading I think you'll still need to write an Objective-C interface/wrapper for your C code before it can be interfaced with RubyMotion. Edit: A discussion topic on the newsgroup about it: https://groups.google.com/d/msg/rubymotion/tn5p3g071OE/5jyJIF2qKdcJ https://groups.google.com/d/msg/rubymotion/tn5p3g071OE/5jyJI... (you'll have to sign up I think)
- lrz 14y agoYes, you can vendor pure C libraries and use their APIs in a RubyMotion project (assuming the C interface is simple enough). Here is an example that uses the OpenGL C APIs: https://github.com/HipByte/RubyMotionSamples/tree/master/HelloGL https://github.com/HipByte/RubyMotionSamples/tree/master/Hel...