Cygwin can't compile c with gcc -
i trying compile c program cygwin , gcc. using windows 8.1
i following error ...
/usr/lib/gcc/x86_64-pc-cygwin/4.9.2/../../../../lib/libcygwin.a(libcmain.o): in function `main': /usr/src/debug/cygwin-1.7.35-1/winsup/cygwin/lib/libcmain.c:39: undefined reference `winmain' /usr/src/debug/cygwin-1.7.35-1/winsup/cygwin/lib/libcmain.c:39:(.text.startup+0x7e): relocation truncated fit: r_x86_64_pc32 against undefined symbol `winmain' collect2: error: ld returned 1 exit status
does know going on here?
my code looks ... (taken link removed... page full of ads
)
edit: link : http://c.learncodethehardway.org/book/ex14.html
#include <stdio.h> #include <ctype.h> // forward declarations int can_print_it(char ch); void print_letters(char arg[]); void print_arguments(int argc, char *argv[]) { int = 0; for(i = 0; < argc; i++) { print_letters(argv[i]); } } void print_letters(char arg[]) { int = 0; for(i = 0; arg[i] != '\0'; i++) { char ch = arg[i]; if(can_print_it(ch)) { printf("'%c' == %d ", ch, ch); } } printf("\n"); } int can_print_it(char ch) { return isalpha(ch) || isblank(ch); } int main(int argc, char *argv[]) { print_arguments(argc, argv); return 0; }
on command line run ...
gcc learn.c -wall -o learnc.exe
i run code yesterday. have not made change system settings or file structure.
thanks!