Click to See Complete Forum and Search --> : Linker Errors under Linux


Kohinoor24
September 26th, 2002, 04:17 AM
Iam compiling a project under Linux.Iam giving the following compile & link options.


compileOPtions = "-o -xc++ -c -w -g -I./inc -D_UNICODE -DM_UNIX"
LinkOptions = "-Wl,-R/opt/gcc3/lib -L. -L/opt/gcc3/lib -lpthread -lstdc++ -lgcc_s -oToken_exe"

It compiles,produces the .o file.But Iam getting the following Link Errors.
Iam sending as attachment a file Pjt.h which contains all the undefined references.

In my token.cpp contains the main() Func
& Iam DECLARING #include "PJT.h" there



/usr/bin/ld: Dwarf Error: Invalid or unhandled FORM value: 14.
/usr/bin/ld: Dwarf Error: Could not find abbrev number 784.
obj/Token.o: In function `main':
obj/Token.o(.text+0x1ed): undefined reference to `pjtOpenStep'
obj/Token.o(.text+0x1f2): undefined reference to `pjtGetFirst'
obj/Token.o(.text+0x326): undefined reference to `pjtGetNext'
obj/Token.o(.text+0x362): undefined reference to `pjtClose'
collect2: ld returned 1 exit status
make: *** [Test] Error 1

could any one help...

PaulWendt
September 26th, 2002, 06:17 AM
It looks like you're compiling code that uses pjt* functions, but
you're not actually linking the pjt* functions into the program.
You should have something like:

LinkOptions = YourLinkOptions ... -L/PJT/path -lpjt

Try that and see what happens. I have no idea what that
DWARF error is.

--Paul

cup
September 26th, 2002, 07:03 AM
DWARF is the Linux debug info format. The object format is ELF. Linux uses elf and dwarf instead of coff and stabs or ecoff.

Kohinoor24
September 26th, 2002, 09:02 AM
I was able to compile & Run it.I gave the library name & the library path.The problem was my Library was named LIBPJT.A(In capital).I renamed the library to small letters & then everything was running fine.

so Thank you both of u..