Meph1st0
February 10th, 2011, 02:08 AM
I'm just started a very basic introductory course on C and I'm already running into problems simply compiling the first bit of code. Here what's found in the student file titled L1-1.C:
/*
* welcome.c - This program prints a welcome message to the screen, and uses
* a variable to display the length of this course in days.
*/
#include <stdio.h>
main()
{
int num;
num = 4;
printf("\nWelcome to the C course.");
printf("\nThis course is %d days long.", num);
}
When I attempt to compile this with gcc L1-1.C I get the following output:
/tmp/cclEt4oo.o:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
I've installed build-essential but that's about it. The file though might have been created with windows notepad or similar. Is it possible that it's choking on some sort of Windows file format?
/*
* welcome.c - This program prints a welcome message to the screen, and uses
* a variable to display the length of this course in days.
*/
#include <stdio.h>
main()
{
int num;
num = 4;
printf("\nWelcome to the C course.");
printf("\nThis course is %d days long.", num);
}
When I attempt to compile this with gcc L1-1.C I get the following output:
/tmp/cclEt4oo.o:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
I've installed build-essential but that's about it. The file though might have been created with windows notepad or similar. Is it possible that it's choking on some sort of Windows file format?