On 5/17/06, Trent Piepho <xyzzy at speakeasy.org> wrote:
> On Wed, 17 May 2006, Stephen Thorne wrote:
> > gcc -o newscores  -I/opt/local/include -Wall  -DRSA -I../include
> > newscores.o ../ntserv/libnetrek.a   -lresolv -lm
>
> This should work.  It works on Linux.  Have you tried changing
> ../ntserv/libnetrek.a to -L../ntserv -lnetrek

Yes, it should work, and I've verified that it doesn't work using gcc3
or gcc4 under OSX, and does work using gcc3 and gcc4 under linux. This
is why I'm so confused. I've asked for help from a few sources, and
come up with "it should work" from some very experienced folks.

Datapoint, using your suggestion of -L$path -l$name, including the
relevent nm output to make sense of the ld errors.

shiny:/tmp stephen$ nm three.o
         U _bar
00000000 T _main
         U dyld_stub_binding_helper
shiny:/tmp stephen$ nm libfoo.a

libfoo.a(one.o):
00000100 C _foo

libfoo.a(two.o):
00000000 T _bar
         U _foo
shiny:/tmp stephen$ gcc three.o libfoo.a
/usr/bin/ld: Undefined symbols:
_foo
collect2: ld returned 1 exit status
shiny:/tmp stephen$ gcc -L. -lfoo three.o
/usr/bin/ld: Undefined symbols:
_bar
collect2: ld returned 1 exit status

-- 
Stephen Thorne

"Give me enough bandwidth and a place to sit and I will move the world."
  --Jonathan Lange