CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2001
    Posts
    745

    Linker Errors under Linux

    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...
    Attached Files Attached Files
    • File Type: h pjt.h (4.2 KB, 72 views)

  2. #2
    Join Date
    May 2000
    Location
    Phoenix, AZ [USA]
    Posts
    1,347
    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:
    Code:
    LinkOptions = YourLinkOptions ... -L/PJT/path -lpjt
    Try that and see what happens. I have no idea what that
    DWARF error is.

    --Paul

  3. #3
    Join Date
    Jun 2002
    Location
    Letchworth, UK
    Posts
    1,020
    DWARF is the Linux debug info format. The object format is ELF. Linux uses elf and dwarf instead of coff and stabs or ecoff.
    Succinct is verbose for terse

  4. #4
    Join Date
    Oct 2001
    Posts
    745

    It Ran.....

    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..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured