The following is the simplest Tcl extension you can write.

Under Linux compile just typing "make"
Under *BSD you probably need "gmake"

After the extension is compiled, execute the tclsh
and load the extension with:

  load tclskeleton.so

Then try the commnad it implements, ::skeleton::hello
This command returns the string "Hello World".

Example session:

 sh-2.05b$ ls
 Makefile  README  tclskeleton.c

 sh-2.05b$ make
 Making dependences
 gcc -I/usr/include/tcl8.4 -fPIC -Wall -O2 -g  -c tclskeleton.c -o tclskeleton.o
 rm -f tclskeleton.so
 ld -G -z text -o tclskeleton.so tclskeleton.o -ldl -lm -lc

 sh-2.05b$ tclsh
 % load tclskeleton.so
 % ::skeleton::hello
 Hello World!
 %

