[Gambas-devel] API declaration error 1.9.8

Benoit Minisini gambas at ...1...
Mon May 30 15:57:02 CEST 2005


On Friday 13 May 2005 13:09, Daniel Campos wrote:
> Hi Benoît:
>
> The GTK+-2.0 library in current systems is called:
>
> "libgtk-x11-2.0.so" and "libgtk-x11-2.0.so.0" at /usr/lib
>
> Well, I didn't found a way to declare this function in Gambas, as it seems
> to add extensions ".so", ".so.0" where it wants, for example:
>
> LIBRARY "libgtk-x11-2.0"
>
> EXTERN gtk_init(Argc As Pointer,Argv As Pointer)
> ...
> gtk_init(0,0)
>
> Error: Can not find dynamic library "libgtk-x11-2.so.0"
>
> Or:
>
> LIBRARY "libgtk-x11-2.0.so"
>
> Error: Can not find dynamic library "libgtk-x11-2.0.so.so"
>
> Or:
>
> LIBRARY "libgtk-x11-2"
>
> Error: Can not find dynamic library "libgtk-x11-2.so"
>
>
> Couldn't you test if the "literal" name of the library exists in the
> PATH before changing
> and adding extensions, or may be add any symbol to specify you want that
> "literal" name
> instead of changing it? It is very confusing...
>
> The same problem happens to Glib, and GObject.
>
> Regards,
>
> D. Campos
>

Here is how I fixed that:

- Now you must not put the shared library extension in the library name. It is 
automatically added.

- If you have to specify the library version number, you must add at the end 
of the library name  the ':' character followed by the version. For example 
"libgtk-x11-2.0:0" will be transformed into "libgtk-x11-2.0.so.0" on Linux 
and "libgtk-x11-2.0.0.dylib" on MacOSX (for example).

Regards,

-- 
Benoit Minisini
mailto:gambas at ...1...




More information about the Devel mailing list