SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Mar 2009
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy undefined reference to '__gxx_personality_v0'

    Hi,
    I'v tried to compile a small test program with cc/gcc
    but I'v got the following error:
    /tmp/ccD16111.o<.eh_frame+0x11>: undefined reference to '__gxx_personality_v0' collect2: ld command 1 exit status

    I did EXACTLY as in the book.
    What can I do ????????

    Code:
    #include<stdio.h>
    
    int main(){ 
    
        printf("0");
        return 0; 
    
    }
    cvv3@yahoo.com



  2. #2
    SitePoint Member
    Join Date
    Mar 2009
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What is the name of the file your trying to compile.

    If the file name finish by .cc .cp .cxx .cpp .CPP. c++ .C
    gcc will preprocessed source code as C++ source code.
    In this case you should link your program to the libstdc++ which define the reference __gxx_personality_v0
    For do that just run
    Code:
    gcc file.cpp -lstdc++
    and the trick will be done.

    But i you don't specially do C++ and compile with gcc. Just rename your source code in .c
    And run
    Code:
    gcc file.c


Bookmarks

Posting Permissions

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