How to use TCL Commands like Tcl_EvalFile... in C code

greenspun.com : LUSENET : Tool Command Language (Tcl) : One Thread

Hi,

I downloaded the source release for tcl8.3(unix version) and compiled it on my sun solaris server. I could install tclsh8.3 also properly. But when I wanted to write a small C program which uses tcl libraries like Tcl_EvalFile and Tcl_CreateInterp etc. to call a sample tcl program, the compiler is not recognising these commands. What option should I use while compiling the C code. My lib directory was created under /usr/soma/lib. So when I tried to give an option -l/usr/soma/lib/tcl8.3 it gave an error. Can anyone please suggest.

Thanks Soma

-- Soma Premaleela (soma_premaleela@isoftel.com), June 17, 2001

Answers

The way c works is like this:

cc -c -I/usr/soma/include file.c -L/usr/soma/lib -ltcl8.3 -o mycommand

The newsgroup news:comp.lang.tcl (reachable via http://groups.google.com/) is very useful reading for questions of this type, as is http://purl.org/thecliff/tcl/wiki/ and http://purl.org/tcl/faqs/ ,

-- Larry W. Virden (lvirden@yahoo.com), June 18, 2001.


Moderation questions? read the FAQ