Compile, Link, and Run GTK on i5.nyu.edu

i5.nyu.edu has two versions of GTK. Version 1.2 is in the following directory and “shared object” library. (This is the version that the i5 /usr/sfw/bin/gtk-config knows about.)

/usr/sfw/include/gtk-1.2
/usr/sfw/lib/libgtk.so
Version 2.0 is in
/opt/csw/include/gtk-2.0
/opt/csw/lib/libgtk-x11-2.0.so
The manual page for libgtk says to run the command
/usr/sfw/bin/info gtk
which displays a “hello, world” C program that uses GTK. See g++ (p. 56) for the -I option; ld for the -L and -R options.

main.C makefile

Run

To run the C program on i5.nyu.edu, launch an X Window server such as X11.app on Mac OS X. Log into i5 via the X Window server:

ssh -Y abc1234@i5.nyu.edu
Launch the C program by saying
echo $DISPLAY
localhost:10.0
./a.out
echo $?
You may have to pull down the X11 Window menu and select Bring All to Front.