Chamith Kumarage skrev:

On Wed, 2006-01-11 at 17:03 -0700, Martell, Larry wrote:
On Wed 1/11/2006 4:43 PM Per-Anton Rønning wrote:
Hi all!
Any C/C++ progremmers out there? I have just installed gcc 3.3.2
(Mandrakelinux 10.0) and I am about to
try it out. A very simple program (3 statements) still results in a
cryptic  error message

make -k vinWS
gcc  -o vinWS  vinWS.cc
/home/par/tmp/ccuXGsh7.o(.eh_frame+0x11): undefined reference to
`__gxx_personality_v0'
collect2: ld returned 1 exit status
make: *** [vinWS] Error 1
Compilation exited abnormally with code 2 at Thu Jan 12 00:26:56

From time to time such errors pop up, but they always seem to have an
obvious reason.

How could a program like this cause such an error:
---------------------------------------
#include <stdio.h>
#include <stdlib.h>
#include <math.h> #include "/home/par/libs/baselib.h"

// --- #define ----
// --- Externals  ----

// --- Function Prototypes ----


// --- Files      ----

FILE *fopen(const char *fn, const char *mode);

// --- structs ----
// --- definition of variables ----
char cmd[100];

/*=======================================================*/
int main(int argv,char *argc[]){
 int i,j,k,l,m,n;

sprintf(cmd,"ls ./WS/*.htm*");
printf("cmd=%s\n",cmd);
i=system(cmd);
}
/*====================================================*/
Statements like this I have written 1000's of times in previous C programs.
Is there something missing in my gcc compiler? I installed it today.

Your program compiles and runs fine on my 10.1 system, which has gcc 3.4.1.
So I would guess that your gcc installation is somehow screwed up.

HTH,
-larry


Hi,

In my machine also your program compiles fine (I used gcc 3.4.1)
I suggest it's better to upgrade your gcc to a newer version.

        - GNU/ChAMI
Thank you for this!

What I did: In Easy Urpmi I changed the reference to 10.1. Updating of the database came through without
error messages, and so did
$urpmi gcc.

$rpm -q gcc   now shows version 3.4.1-4mdk.
So far so good.

But still the same program errors occur!

But som trials with the code shows that this error message is triggered by certain statements.
the sprintf statement went fine.
I alse tried to initialize  i=0; that went  fine.
But the
printf
and
i=system(cmd) provoked an error message.

I checked for gcc, and
usr/lib/gcc-lib/i586-mandrake-linux-gnu
has a subdirectory named 3.3.2 (the previous version that I installed)

I don't know why this is still there, since I have removed this package from Rpmdrake. I also don't know whether the compiler uses it. Should I take the risk of removing it maybe, or rename it? Experience has taugt me to be very careful to tamper vith individual files in an installation.

The gcc directiory:
usr/lib/gcc/i586-mandrake-linux-gnu has two subdir's,
3.4.0 and 3.4.1

So I don't know, and I have never ever encountered problems of this kind before.
The C-compiler has always been there and it has worked.

My previous istallations are
Red Hat 6.0,6.2,7.2
SUSE 9.1 (stay clear!)
and now:
Mandrakelinux 10.0

Mandrake works very well in all other respects, and I am satisfied with it.

PA

____________________________________________________
Want to buy your Pack or Services from Mandriva? Go to http://store.mandriva.com
Join the Club : http://www.mandrivaclub.com
____________________________________________________

Reply via email to