ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> tcl-mac
tcl-mac
Re: [MACTCL] Undefined symbol _Init?
by Jim Ingham other posts by this author
Mar 27 2003 7:14PM messages near this date
[MACTCL] Undefined symbol _Init? | Re: [MACTCL] Undefined symbol _Init?
David,

Tcl is finding the shared library, if it didn't you would get a  
different error. BUt Tcl is not able to initialize the library because  
it can't find the initialization functions it expects.

The way Tcl loads a shared library extension is it takes the name of  
the shared library (or the package name if you have passed that into  
"package require"), upper-cases the first letter, lower-cases all the  
others, adds _Init and looks up that symbol and runs the function.

A common mistake is to forget the weirdo capitalization rules (which  
were invented to get around non-case-sensitive file systems).

Does your library indeed define Crax_Init and Crax_SafeInit functions?   
And are they exported?

You can use

nm /Users/drobin/Library/Tcl/CRAX/CRAX.dylib

You should see a "T" symbol (exported text) for both of these.

Jim

On Thursday, March 27, 2003, at 10:51  AM, David Robinson wrote:

>  Okay I realize that this is going to be a rather vague question and I  
>  apologize in advance but I'm not sure how to approach this.
> 
>  We've succeeded in building a Tcl extension in a fashion similar to  
>  TclSpeech (called CRAX).  However, when we execute 'package require  
>  CRAX' the following dump appears in the Wish console:
> 
>  package require CRAX
>  dyld: /Applications/Utilities/Wish Shell.app/Contents/MacOS/Wish Shell  
>  NSLookupSymbolInImage() dynamic library:  
>  /Users/drobin/Library/Tcl/CRAX/CRAX.dylib does not define symbol:  
>  _Crax_Init
>  dyld: /Applications/Utilities/Wish Shell.app/Contents/MacOS/Wish Shell  
>  NSLookupSymbolInImage() dynamic library:  
>  /Users/drobin/Library/Tcl/CRAX/CRAX.dylib does not define symbol:  
>  _Crax_SafeInit
>  couldn't find procedure Crax_Init
> 
>  It seems that the right library/Framework is not being linked in our  
>  infinite ignorance we've not been able to determine what we are  
>  missing.  Any suggestions or even guesses would be appreciated.
> 
>  Thanks for your patience,  Dave
> 
>  ----------------------------------------------------------------------- 
>  -------
>  Q: What do you have when 100 Manchester United Fans are buried up to  
>  their  necks in sand?
>  A: Not enough sand.
> 
> 
> 
>  -------------------------------------------------------
>  This SF.net email is sponsored by:
>  The Definitive IT and Networking Event. Be There!
>  NetWorld+Interop Las Vegas 2003 -- Register today!
>  http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en
>  _______________________________________________
>  Tcl-mac mailing list
>  Tcl-mac@[...].net
>  https://lists.sourceforge.net/lists/listinfo/tcl-mac
> 
--
Jim Ingham                                   jingham@[...].com
Developer Tools
Apple Computer



-------------------------------------------------------
This SF.net email is sponsored by:
The Definitive IT and Networking Event. Be There!
NetWorld+Interop Las Vegas 2003 -- Register today!
http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en
_______________________________________________
Tcl-mac mailing list
Tcl-mac@[...].net
https://lists.sourceforge.net/lists/listinfo/tcl-mac
Thread:
Jim Ingham
David Robinson

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved