qedprigmosynois
June 28th, 2010, 07:39 PM
Sorry, im pretty new to C/ C++ but i was hoping if someone could tell me what is wrong with my code/IDE which is cygwin compiler in Netbeans.
I wrote a basic helloworld source code as following:
#include <stdio.h>
int main(void)
{
printf("Hello World");
return 0;
}
but i get this
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory `/cygdrive/c/Users/username/Documents/NetBeansProjects/helloworld'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/Cygwin_1-Windows/helloworld.exe
make[2]: Entering directory `/cygdrive/c/Users/username/Documents/NetBeansProjects/helloworld'
mkdir -p dist/Debug/Cygwin_1-Windows
g++.exe -o dist/Debug/Cygwin_1-Windows/helloworld build/Debug/Cygwin_1-Windows/main.o build/Debug/Cygwin_1-Windows/helloworld.o
build/Debug/Cygwin_1-Windows/helloworld.o: In function `main':
/cygdrive/c/Users/username/Documents/NetBeansProjects/helloworld/helloworld.c:4: multiple definition of `_main'
build/Debug/Cygwin_1-Windows/main.o:/cygdrive/c/Users/username/Documents/NetBeansProjects/helloworld/main.cpp:15: first defined here
collect2: ld returned 1 exit status
make[2]: *** [dist/Debug/Cygwin_1-Windows/helloworld.exe] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
make[2]: Leaving directory `/cygdrive/c/Users/username/Documents/NetBeansProjects/helloworld'
make[1]: Leaving directory `/cygdrive/c/Users/username/Documents/NetBeansProjects/helloworld'
BUILD FAILED (exit value 2, total time: 1s)
any help would be appreciated.
Thank you
I wrote a basic helloworld source code as following:
#include <stdio.h>
int main(void)
{
printf("Hello World");
return 0;
}
but i get this
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory `/cygdrive/c/Users/username/Documents/NetBeansProjects/helloworld'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/Cygwin_1-Windows/helloworld.exe
make[2]: Entering directory `/cygdrive/c/Users/username/Documents/NetBeansProjects/helloworld'
mkdir -p dist/Debug/Cygwin_1-Windows
g++.exe -o dist/Debug/Cygwin_1-Windows/helloworld build/Debug/Cygwin_1-Windows/main.o build/Debug/Cygwin_1-Windows/helloworld.o
build/Debug/Cygwin_1-Windows/helloworld.o: In function `main':
/cygdrive/c/Users/username/Documents/NetBeansProjects/helloworld/helloworld.c:4: multiple definition of `_main'
build/Debug/Cygwin_1-Windows/main.o:/cygdrive/c/Users/username/Documents/NetBeansProjects/helloworld/main.cpp:15: first defined here
collect2: ld returned 1 exit status
make[2]: *** [dist/Debug/Cygwin_1-Windows/helloworld.exe] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
make[2]: Leaving directory `/cygdrive/c/Users/username/Documents/NetBeansProjects/helloworld'
make[1]: Leaving directory `/cygdrive/c/Users/username/Documents/NetBeansProjects/helloworld'
BUILD FAILED (exit value 2, total time: 1s)
any help would be appreciated.
Thank you