[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

.so and .a libs, tcl, postgres = in over my head



Hi.. I've got one that I'd like to air here before I go filing bugs,
and because I'm not even sure what the problem is really...

I have the following program (well, not really, but it is a boiled
down example), called mytclsh.

#include <tcl.h>

int main (int argc, char *argv[])
{
  int rt;
  char *er;
  Tcl_Interp *interp;

  interp = Tcl_CreateInterp();
  rt = Tcl_EvalFile(interp, argv[1]);
  
  er =  Tcl_GetVar(interp, "errorInfo", NULL);
  puts(er);
}

Compiled with gcc -o mytclsh mytclsh.c -ltcl8.0, it seems to work
pretty well, when run like this:

mytclsh foobar.tcl, where foobar.tcl is this:

load libpgtcl.so
puts "hello world"

Everything is ok so far...

But, when I compile like so:
gcc -o mytclsh mytclsh.c /usr/lib/tcl8.0.a -lm -ldl

It can run "normal" tcl programs, like
puts "hello world", but it seems to choke on the load, like this:
@hrothgar [~] $mytclsh tcltest.tcl 
couldn't load file "libpgtcl.so": /usr/lib/libpgtcl.so: undefined
symbol: Tcl_GetChannel
    while executing
"load libpgtcl.so"
    (file "tcltest.tcl" line 1)

I've given a look at this, but...frankly, I'm a bit lost between all
the static and dynamic and what not.

So.. hrmmm.. is this a problem with the postgres... tcl.. me?

Interesting.. I try compiling like this:
gcc -o mytclsh mytclsh.c /usr/lib/tcl8.0.a /usr/lib/libm.a /usr/lib/libdl.a

and I get:
@hrothgar [~] $mytclsh tcltest.tcl 
couldn't load file "libpgtcl.so": /lib/libcrypt.so.1: undefined symbol:	_ufc_foobar
    while executing
"load libpgtcl.so"
    (file "tcltest.tcl" line 1)

Hrmm.. linking against libcrypt.a does not improve anything...

Ok, it's late and I'm confused.. 

Thanks:-)
-- 
David Welton                          http://www.efn.org/~davidw 

	Debian GNU/Linux - www.debian.org


--  
To UNSUBSCRIBE, email to debian-devel-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org


Reply to: