Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old November 23rd, 2005, 12:28 AM
Jerry LeVan
Guest
 
Posts: n/a
Default Tcl load command and mac os x

At the time I built Postgresql 7.4.2 I did not have aqua Tcl/Tk
installed.

The Aqua Tcl/Tk version installs in a different location the the apple
supplied Tcl ( apple does not supply Tk). I built with support for Tcl
and it found the apple supplied version and built pgtclsh and libpgtcl.a
and a libpgtcl.so

If I start the "regular" tclsh and try to use the load command I get
load
failures

% load libpgtcl
dyld: tclsh can't open library: libpgtcl (No such file or directory,
errno = 2)

% load /usr/local/pgsql/lib/libpgctl
dyld: tclsh can't open library: /usr/local/pgsql/lib/libpgctl (No such
file or directory, errno = 2)

% load /usr/local/pgsql/lib/libpgtcl
dyld: tclsh can't open library: /usr/local/pgsql/lib/libpgtcl (No such
file or directory, errno = 2)

% load /usr/local/pgsql/lib/libpgtcl.so
dyld: tclsh malformed library: /usr/local/pgsql/lib/libpgtcl.so (not a
Mach-O library file, bad filetype value)

% load /usr/local/pgsql/lib/libpgtcl.a
dyld: tclsh malformed library: /usr/local/pgsql/lib/libpgtcl.a (not a
Mach-O file, bad magic number)

Question 1) Is it possible to dynamically load the postgresql stuff
into an "ordinary" tclsh?


Question 2) Since I have Apple's Tcl and the Aqua Tcl/Tk how do I force
config to use the
aqua version?

Thanks


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

  #2  
Old November 23rd, 2005, 12:28 AM
Daniel A. Steffen
Guest
 
Posts: n/a
Default Re: [MACTCL] Tcl load command and mac os x

Jerry,

On Wednesday, Apr 7, 2004, at 08:25 Australia/Sydney, Jerry LeVan wrote:[color=blue]
> % load /usr/local/pgsql/lib/libpgtcl.so
> dyld: tclsh malformed library: /usr/local/pgsql/lib/libpgtcl.so (not a
> Mach-O library file, bad filetype value)[/color]

this should do it, however it appears that your library isn't a Mac OS
X shared library, probably you built a MachO bundle instead of a MachO
dylib. You'll have to look at the postgres buildsystem to see why it
doesn't use the information in tclConfig.sh (i.e. TCL_SHLIB_LD) to
build tcl extensions. The link line should use '-dynamiclib' and not
'-bundle', c.f. 'man ld' for details.

also, you really want to use the OSX standard .dylib shared library
extension, so that you can use
[load libpgtcl[info sharedlibextension]]
in cross-platform tcl code.
[color=blue]
> % load /usr/local/pgsql/lib/libpgtcl.a
> dyld: tclsh malformed library: /usr/local/pgsql/lib/libpgtcl.a (not a
> Mach-O file, bad magic number)[/color]

you cannot load static libraries
[color=blue]
> Question 2) Since I have Apple's Tcl and the Aqua Tcl/Tk how do I
> force config to use the
> aqua version?[/color]

if postgres has a TEA compliant configure script, use
./configure --with-tcl=/Library/Frameworks/Tcl.framework
--with-tclinclude=/Library/Frameworks/Tcl.framework/Headers

similar issues have come up many many times before on the tcl-mac list,
you may want to consult the list archives...

Cheers,

Daniel

--
** Daniel A. Steffen ** "And now for something completely
** Dept. of Mathematics ** different" Monty Python
** Macquarie University ** <mailto:steffen@maths.mq.edu.au>
** NSW 2109 Australia ** <http://www.maths.mq.edu.au/~steffen/>


---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles