GCC COMMANDLINE OPTIONS PART 8 -ansi

commandline session

$cat main.c
#include<stdio.h>
#include<math.h>

int main(void)
{
 int i=0;
   float y;
   printf("n The Geek Stuff [%d]n", i);
   y=sinf(2.5);
   printf("%fn",y);
   return 0;
}
$gcc -ansi main.c
/tmp/ccBNR3rx.o: In function `main':
main.c:(.text+0x3c): undefined reference to `sinf'
collect2: error: ld returned 1 exit status
$gcc  main.c
$

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s