Compile error

Kris Kennaway kris at obsecurity.org
Sat Sep 13 13:23:31 PDT 2003


On Sat, Sep 13, 2003 at 10:52:29AM -0700, Claudiu Bichir wrote:
> Hy guys ! I'm triyng to compile this simple prog. in FreeBSD 5.0:
> #include <stdio.h>
> #include <netdb.h>
>  
> int main()
> {
> char h[80];
> struct hostent *x;
>  
> printf("Host:");scanf("%s",h);
> x=gethostbyname(h);
> printf("%s\n", x->h_addr_list[0][0]);
> return 0;
> }
>  
>  but it gives me the fallowing error 
> /var/tmp//ccDxQUWw.o(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
> Does anybody know why ?

What command are you using to compile this?  That error typically
means you're trying to link C++ code using the C compiler, which will
not work (you need to link it with the C++ compiler), but your example
doesn't support this.

Kris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20030913/a6dfeb08/attachment.bin


More information about the freebsd-questions mailing list