FreeImage-FFI

J

jonty

In view of ImageScience being currently broken on ruby 1.9 I thought it
would be a good idea to try and use FFI with FreeImage. And lo! this has
been tried last April, repositories on github.

http://github.com/adamsanderson/freeimage-ffi

Fine but none of the code I have tried work with the precompiled dll of
freeImage for windows.

This illustrates my problem:

require 'ffi'

module TestFreeImage
extend FFI::Library
ffi_lib 'FreeImage'
ffi_convention :stdcall
attach_function :getversion, :FreeImage_GetVersion , [], :char
end

version=TestFreeImage.getversion

puts "Version is #{version}"


Gives the following error:

`attach_function': Function 'FreeImage_GetVersion' not found in
[FreeImage] (FFI::NotFoundError)
from testimagescience.rb:7:in ` said:
Exit code: 1


here is the header from freeimage.h

DLL_API const char *DLL_CALLCONV FreeImage_GetVersion(void);

When trying the freeimage-ffi tests I get the same error, incidentally I
had to hack that as it looks for freeimage.3 only. I changed like above
- it seems to be finding the dll ok.
(in windows/system32)

Can anyone shed light on this? I am not a C programmer
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,836
Messages
2,569,748
Members
45,545
Latest member
rapter____0

Latest Threads

Top