Annick
FFI can call a function but it needs to know where is your library.
Stef
On 13/8/14 15:46, Annick Fron wrote:
I want to interface some pharo code with gstreamer. But gstreamer does
not come up with a dylib, it requires compilation flags for instance
for a C program.
The compile options are :
-pthread -I/usr/include/gstreamer-1.0 -I/usr/include/glib-2.0
-I/usr/lib/i386-linux-gnu/glib-2.0/include -lgstreamer-1.0
-lgobject-2.0 -lglib-2.0
so if I don’t know which module to use in FFI. If I put
/usr/lib/gstreamer-1.0
I get an error « module not found ».
Since it is handled by pragmas it is very difficult to debug.
Annick
Le 13 août 2014 à 13:11, Clément Bera <bera.clem...@gmail.com
<mailto:bera.clem...@gmail.com>> a écrit :
I don't understand, do you want to compile your library using FFI or
do you want to bind a library compiled your way with FFI ?
If you want to compile your library using FFI, then use OSProcess to
run the compilation line you showed.
If you want to bind a library compiled your way with FFI, the easiest
way is to compile the C files as a dylib with something like:
*gcc -shared -m32 -Wall helloworld.c -o helloworld.dylib $(pkg-config
--cflags --libs gstreamer-1.0)*
(replace .dylib by .so or .dll if you're on windows or on Mac).
Then you can bind the dynamic library generated with FFI. I am not
sure about the FFI syntax but with NativeBoost it would look like:
Integer>>fib4NB
<primitive: #primitiveNativeCall module: #NativeBoostPlugin
error: errorCode>
^ self
nbCall: #( int functionToCall (int self) )
module: '/Users/myName/Desktop/helloWorld.dylib'
Regards,
Clement
2014-08-13 11:55 GMT+02:00 Annick Fron <i...@afceurope.com
<mailto:i...@afceurope.com>>:
Hi,
I would like to compile a FFI program but the compiling implies
compile flags like in the following :
*gcc -Wall helloworld.c -o helloworld $(pkg-config --cflags
--libs gstreamer-1.0)*
*
*
*How do I do this with FFI ?*
*
*
*Annick*