PDA

View Full Version : [ubuntu] wrong libc.so.6 installed by default?



patiobarbecue
May 5th, 2008, 05:03 AM
(1) installed 7.10 i386 on my Dell XPS M1210
(2) sudo apt-get install build-essentials
(3) compiled temp.c using gcc -Wall -g -O2 temp.c
(4) ./a.out shows
hello, world again!
Segmentation fault (core dumped)
(5) gdb shows 0xb7e52d53 in strcat () from /lib/tls/i686/cmov/libc.so.6

temp.c file content:
#include <stdio.h>
#include <string.h>

int main(int argc, char **argv){
printf("hello, world again!\n");
printf("%s\n",strcat(argv[1],argv[2]));
}

what's wrong? thanks!

patiobarbecue
May 5th, 2008, 06:08 AM
oh, it works after I reinstalled the build-essential. I close this thread. Thanks.