c - I can't build HELLO, WORLD program? -
i new learning c , i'm on windows (i want learn on windows).
i have installed gcc on cygwin, , i'm using netbeans ide.
source:
#include <stdio.h> main() { printf("hello, world!\n"); return 0; }
i error when building above code:
"/usr/bin/make" -f nbproject/makefile-debug.mk qmake= subprojects= .build-conf make[1]: entering directory `/cygdrive/g/vs projects/hello world' "/usr/bin/make" -f nbproject/makefile-debug.mk dist/debug/cygwin_4.x-windows/hello_world.exe make[2]: entering directory `/cygdrive/g/vs projects/hello world' mkdir -p build/debug/cygwin_4.x-windows rm -f build/debug/cygwin_4.x-windows/helloworld.o.d gcc -c -g -mmd -mp -mf build/debug/cygwin_4.x-windows/helloworld.o.d -o build/debug/cygwin_4.x-windows/helloworld.o helloworld.c mkdir -p dist/debug/cygwin_4.x-windows gcc -o dist/debug/cygwin_4.x-windows/hello_world build/debug/cygwin_4.x-windows/helloworld.o build/debug/cygwin_4.x-windows/main.o build/debug/cygwin_4.x-windows/main.o: in function `main': /cygdrive/g/vs projects/hello world/main.c:14: multiple definition of `main' build/debug/cygwin_4.x-windows/helloworld.o:/cygdrive/g/vs projects/hello world/helloworld.c:4: first defined here collect2: error: ld returned 1 exit status nbproject/makefile-debug.mk:63: recipe target `dist/debug/cygwin_4.x-windows/hello_world.exe' failed make[2]: *** [dist/debug/cygwin_4.x-windows/hello_world.exe] error 1 make[2]: leaving directory `/cygdrive/g/vs projects/hello world' nbproject/makefile-debug.mk:60: recipe target `.build-conf' failed make[1]: *** [.build-conf] error 2 make[1]: leaving directory `/cygdrive/g/vs projects/hello world' nbproject/makefile-impl.mk:39: recipe target `.build-impl' failed make: *** [.build-impl] error 2 build failed (exit value 2, total time: 562ms)
is there simple way learn c on windows? (visual studio gave me errors , seems c++, that's not option)
the problem gcc
or netbeans configuration
it's working fine here
// helloworld.c #include <stdio.h> main() { printf("hello, world!\n"); return 0; }
compile myprog
$ gcc helloworld.c -o myprog
run it
$ ./myprog # => hello, world!
Comments
Post a Comment