g++ / ld / publib linking problem
No-one has attempted an answer to this yet; if you have any ideas,
please let me know!
------- Repeated Message
Date: Fri, 04 Jul 1997 22:21:39 +0100
From: "Oliver Elphick" <firstname.lastname@example.org>
Subject: Problem linking with publib library and g++
I have a linking problem when I try to include functions from the
publib library in a C++ program. This worked before I upgraded
to the new releases (see below).
An easy example:
char *x = "This is a string with spaces ";
printf ("%s-\n%s-\n", x, y);
When I try to compile this as C++:
linda:~/cprogs$ g++ main.c -lpub
/tmp/cca132571.o: In function `main':
/tmp/cca132571.o(.text+0x2b): undefined reference to `strtrim(char *)'
/tmp/cca132571.o(.text+0x3a): undefined reference to `strmtrim(char *)'
but as C, it's fine:
linda:~/cprogs$ gcc main.c -lpub
I can't work out what has changed and why this no longer works.
System: Pentium Pro
Debian: 1.3 from unstable
------- End of Repeated Message
Even if I include the library directly on the command line, it doesn't
linda:~/cprogs$ g++ main.c /usr/lib/libpub.a
/tmp/cca122331.o: In function `main':
/tmp/cca122331.o(.text+0x2b): undefined reference to `strtrim(char *)'
/tmp/cca122331.o(.text+0x3a): undefined reference to `strmtrim(char *)'
but again, gcc finds it:
linda:~/cprogs$ gcc main.c /usr/lib/libpub.a
so it must be something different about the ways that gcc and g++ expect
to find things in libraries???
Since the original message, I have tried loading the source of publib
and recompiling it; this made no difference (there was no reason why
it should, but I'm clutching at straws now...)
Oliver Elphick Oliver.Elphick@lfix.co.uk
Isle of Wight http://lfix.co.uk/oliver
Make it idiot-proof, and someone will breed a better idiot.
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
Trouble? e-mail to email@example.com .