Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 13 Sep 2003 13:23:24 -0700
From:      Kris Kennaway <kris@obsecurity.org>
To:        Claudiu Bichir <claudiubichir@yahoo.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Compile error
Message-ID:  <20030913202324.GB17596@rot13.obsecurity.org>
In-Reply-To: <20030913175229.68285.qmail@web41312.mail.yahoo.com>
References:  <20030913175229.68285.qmail@web41312.mail.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
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

[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (FreeBSD)

iD8DBQE/Y3y7Wry0BWjoQKURAu3rAKCWW38NQnkxihMxYP/ZdYYXPoV3pQCg+zhk
0qJtrCFpejk0mhyJdCh7u5o=
=u5q7
-----END PGP SIGNATURE-----

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030913202324.GB17596>