IonicWind Software

IWBasic for Linux => General IWLP Discussion => Topic started by: Doc on May 31, 2007, 10:59:06 PM

Title: Curiosity killed the....... well, you know.
Post by: Doc on May 31, 2007, 10:59:06 PM
Paul,
It's probably beyond my understanding or usefulness at this point, but...

Are we able to link to shared libs (.so) files yet?
Are we able to make GTK calls directly yet?

If so, when you have some time would you mind throwing together some very simple examples, please.  ;D

-Doc-

P.S. I'm having a blast with this already!
Thank you!!!
Title: Re: Curiosity killed the....... well, you know.
Post by: Ionic Wind Support Team on June 01, 2007, 06:04:38 AM
You already have the examples ;)

gtk_main is a function in gtk-x11-2.0.so

The declare for the shared library function looks liike

declare cdecl extern gtk_main()

Look at the ld line again:

ld -lc -lgtk-x11-2.0 -o "heapsort" "heapsort.o" /usr/lib/libebasic.a --dynamic-linker /lib/ld-linux.so.2

libebasic.a is a static library
-lc is the shared C library, when using -l you omit the .so part

So all you need to do is declare cdecl extern the function and include the library on the linker line.  In the case of GTK2.0 it is already being linked of course.

Paul.