Call a function in a shared library: Difference between revisions
Content added Content deleted
(→{{header|Ruby}}: Ruby 2.2 removed DL; switch from DL to Fiddle. Add example with ImageMagick. Make examples work when libraries are missing.) |
(→{{header|Ruby}}: Believe that I need Ruby 2.0 for Fiddle::Importer, and Ruby 1.9 for String#force_encoding.) |
||
Line 1,247: | Line 1,247: | ||
This script uses Fiddle from Ruby's standard library to open <code>fakeimglib.so</code> from the [[#C|C example]]. |
This script uses Fiddle from Ruby's standard library to open <code>fakeimglib.so</code> from the [[#C|C example]]. |
||
{{works with|Ruby|2.0+}} |
|||
<lang ruby>require 'fiddle/import' |
<lang ruby>require 'fiddle/import' |
||
Line 1,272: | Line 1,273: | ||
{{libheader|ImageMagick}} |
{{libheader|ImageMagick}} |
||
{{libheader|RubyGems}} |
{{libheader|RubyGems}} |
||
{{works with|Ruby|1.9+}} |
|||
<lang ruby># This script shows the width x height of some images. |
<lang ruby># This script shows the width x height of some images. |
||
# Example: |
# Example: |