-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
jenea <pu*****@gmail.com> writes:
I write a little test program.
In witch I use getopt_long function...
I included unstd.h , optget.h , stdio.h and stdlib.h
when i try to link the program with gcc -o result main.o
tmp/ccGfK1gp.o(.eh_frame+0x11): undefined reference to
`__gxx_personality_v0'
collect2: ld returned 1 exit status
make: *** [run] Error 1
When I remove call of getopt_long functions the problem disapears...
$ nm -D -C /usr/lib/libstdc++.so.6 | grep __gxx_personality_v0
000a0e70 T __gxx_personality_v0
You are writing C++, not C, and so you need to use g++ rather than gcc
to link.
getopt_long is a red herring; you need to check if you are
unintentionally using C++ features in your program. Assuming you are
writing C, since this is a C group, you need to remove the C++
features from your code and then linking should work fine.
Regards,
Roger
- --
Roger Leigh
Printing on GNU/Linux?
http://gimp-print.sourceforge.net/
Debian GNU/Linux
http://www.debian.org/
GPG Public Key: 0x25BFB848. Please sign and encrypt your mail.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.8 <http://mailcrypt.sourceforge.net/>
iD8DBQFCH3kKVcFcaSW/uEgRAmxhAKDwUQyJod9XpQqV0I0fZUwGHk4NtACeMxm8
yYMzxBelw1S4vRmhFYzoU9Y=
=82rr
-----END PGP SIGNATURE-----