nitesh wrote:
Hi,

I am getting following error when i typed "gcc test.cpp" on my terminal.

Undefined                       first referenced
 symbol                             in file
__gxx_personality_v0                /var/tmp//ccMCa4Bb.o
ld: fatal: Symbol referencing errors. No output written to a.out
collect2: ld returned 1 exit status


its a test program printing hello. I am pasting it for reference.

#include <stdio.h>

int main()
{
printf ("Hello");
return 0;
}

Please help me to resolve..
gcc is deciding that this is a C++ program, but is not linking in the right library. Try renaming your program to "test.c" and then recompiling.

Or, if you're going to build as a C++ program, use the program "g++ hello.cpp" which will cause it to use the full options for C++ code (including linking in any C++ base libraries.)

   - Garrett

_______________________________________________
opensolaris-code mailing list
opensolaris-code@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to