Hey guys, I have a self defined so file that I have been trying to incorporate in a ruby plugin file for use in Sketchup.
Whenever i try to start Sketchup,it loads to a point then crashes.
Can someone offer any advice in this regard
Could you share some of the internals of your .so? Is it a ruby extension?
Use of libFFI with Ruby is done via the Fiddle
library âŚ
You kind of need to poke around the Fiddle docs and modules to see examples.
It can also help searching the web for examples posted in blogs, etc.
How much experience do you have with Ruby ? ⌠and writing C extension for Ruby ?
If you have not much I recommend downloading the PDF book on extending Ruby with C.
You can find it in the Books list, at the bottom of the âDownloadableâ section âŚ
Also see the SketchUp Extensibility Teamâs examples âŚ
thanks a lot
Some people might be able to help, but maybe some more info?
Weâve got a ruby file loading an so file, and it crashes. When you say âcrashesâ, not sure if you mean SketchUp (SU) crashes, or something else.
Is it crashing when you call into it, or on require?
Any error output in the SU Ruby console?
JFYI, normally, an so file can be loaded via require
, and (on Windows) a .dll file would be accessed via ffi/fiddleâŚ
whenever i try loading my .so file using ffi or fiddle, Sketchup (SU) crashes. I mean when I restart SU it just flickers accross the screen, then closes
What version of SketchUp ? What platform ? What version of Ruby did you compile for ?
Ok. Youâve got an .so file.
If you say you have an .so file, most people in Ruby world consider that to be a compiled Ruby extension, similar to the files in your âTools\RubyStdLib\platform_specificâ folder. These can be required just like a normal .rb file. For more info on .so files, see
https://msp-greg.github.io/ruby_trunk/file.extension.html
So, one would not normally load/access an .so file from FFI/Fiddle. FFI/Fiddle are for .dllâs.
So, what Dan said, and additionally, some idea of what the .so file is for, or whatâs communicating with what and in what direction. Whatâs it linked to/dependent on?