undefined reference error while linking..help

This is a discussion on undefined reference error while linking..help within the C++ Programming forums, part of the General Programming Boards category; hi friends I tried to link c++ object files using "bfin-elf-ld" and got some undefined reference errors Errors::::: (.text+0x2ee8): undefined ...

  1. #1
    Registered User
    Join Date
    Dec 2007
    Posts
    3

    undefined reference error while linking..help

    hi friends

    I tried to link c++ object files using "bfin-elf-ld" and got some
    undefined reference errors
    Errors:::::
    (.text+0x2ee8): undefined reference to `operator delete(void*)'
    (.text+0x2ef4): undefined reference to `_Unwind_Resume'
    (.text+0x2efa): undefined reference to `operator new(unsigned long)'
    (.text+0x25f6): undefined reference to `__muldf3'
    (.text+0x2620): undefined reference to `__floatsidf'

    I dont know why its giving these errors..
    Plz help me to fix this

    thanks in advance

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    You need to link with libstc++ or whatever it's called. Are you sure you don't want to use the "g++ -o target objectfile1.o objectfile2.o ..." instead, as the g++ driver will know how to call ld correctly for a C++ project.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    Registered User
    Join Date
    Dec 2007
    Posts
    3
    you are right Matsp..Using g++ instead of ld eliminate the common undefined errors.
    And i got the following error which iam crying to resolve.
    undefined reference to `_register_handler'
    Is there any specific library do i need to link for this function?

    thanks

  4. #4
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    I have no idea what the function "register_handler()" is - but I suspect it's something in your code, or a library that your code should use. Googling for "register_handler" finds LOTS of different uses of that name, so not much help. Perhaps you can do "man register_handler" on your system?

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  5. #5
    Registered User
    Join Date
    Dec 2007
    Posts
    3
    thanks matsp
    i do try what you have suggested

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Getting an error with OpenGL: collect2: ld returned 1 exit status
    By Lorgon Jortle in forum C++ Programming
    Replies: 6
    Last Post: 05-08-2009, 08:18 PM
  2. Undefined Reference Compiling Error
    By AlakaAlaki in forum C++ Programming
    Replies: 1
    Last Post: 06-27-2008, 11:45 AM
  3. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  4. C OpenGL Compiler Error?
    By Matt3000 in forum C Programming
    Replies: 12
    Last Post: 07-07-2006, 04:42 PM
  5. c++ linking problem for x11
    By kron in forum Linux Programming
    Replies: 1
    Last Post: 11-19-2004, 09:18 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21