Skip to main content

Thread: Error compiling C program with GCC in Cygwin


i have basic c program:
code:
/*h2e2.c: first handwritten program*/  #include <stdio.h>    main()  {  	printf ("it's fun write own program in c.\n");  	return 0;  }
when run gcc c compiler in cygwin, following output:
code:
eric@gross-pc ~  $ gcc -o h2e2.exe h2e2.c  h3e2.c:8:2: warning: no newline @ end of file
i don't know means. help? (i know there newline @ end of printf statement, need 1 somewhere else?)

thanks!

ugh... first, let's write in modern standard c.

code:
/*h2e2.c: first handwritten program*/ #include <stdio.h>  int main(void) /* not "main()"!!!*/ { 	printf ("it's fun write own program in c.\n"); 	return 0; }
now onto gcc. notice isn't error, warning. executable surely created , should work... "no newline" thing means file should end blank line... don't remember reason, sure it's legacy thing of none importance.


Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk Error compiling C program with GCC in Cygwin


Ubuntu

Comments

Popular posts from this blog

CS5 Adobe Media Encoder: Encode failed because the source duration is nil.

cf_sql_integer vs cf_sql_bigint vs cf_sql_int??

localhost/joomla15/administrator doesnt work - Joomla! Forum - community, help and support