Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

tcltk && C program as shared library

Status
Not open for further replies.

pinkipons

Programmer
Mar 19, 2002
4
MX
Hi!
I'm installing a tcltk program that requires a C program as a shared library.

When I compile it with
gcc -shared -fPIC -o name.os name.o

I get the following:

ld: 0711-317 ERROR: Undefined symbol: .Tcl_CreateObjCommand
ld: 0711-317 ERROR: Undefined symbol: .Tcl_PkgProvide
ld: 0711-317 ERROR: Undefined symbol: .Tcl_SetResult
ld: 0711-317 ERROR: Undefined symbol: .Tcl_GetObjResult
ld: 0711-317 ERROR: Undefined symbol: .Tcl_NewDoubleObj
ld: 0711-317 ERROR: Undefined symbol: .Tcl_ListObjAppendElement
ld: 0711-317 ERROR: Undefined symbol: .Tcl_NewIntObj
ld: 0711-317 ERROR: Undefined symbol: .Tcl_SetObjResult
ld: 0711-317 ERROR: Undefined symbol: .Tcl_GetStringFromObj
ld: 0711-317 ERROR: Undefined symbol: .Tcl_GetDoubleFromObj
ld: 0711-317 ERROR: Undefined symbol: .cos
ld: 0711-317 ERROR: Undefined symbol: .sin
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
collect2: ld returned 8 exit status


What am I doing wrong?
Thanks for your help,
Pinki Pons
pinkipons@hotmail.com
 
Looks as though you forgot to link with the Tcl libraries (or the Tcl stub libraries, if that's what the extension was built to use). Double check whatever compilation instructions you have for the library to see what all it needs to link with.

You might also want to check with the Tcl'ers Wiki ( for more information on compiling Tcl extensions. The page "How to write C-coded extensions for Tcl," might be a good place to start, following whatever links there that you find most helpful. - Ken Jones, President
Avia Training and Consulting
866-TCL-HELP (866-825-4357) US Toll free
415-643-8692 Voice
415-643-8697 Fax
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top