Netbeans compile problem

I am running windows 7 32bit.
I have netbeans installed using the cygwin compiler.
when i go to run the program i get an error.
do i have a problem with my compiler or code?
Thanks
1
2
3
4
5
6
7
  #include <iostream>
using namespace std;
int main()
{
    cout <<"I love my family";
    
    return 0;

output error:

"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory `/cygdrive/c/Users/Familia/Documents/NetBeansProjects/test'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/Cygwin_4.x-Windows/test.exe
make[2]: Entering directory `/cygdrive/c/Users/Familia/Documents/NetBeansProjects/test'
mkdir -p build/Debug/Cygwin_4.x-Windows
rm -f build/Debug/Cygwin_4.x-Windows/main.o.d
g++ -c -g -MMD -MP -MF build/Debug/Cygwin_4.x-Windows/main.o.d -o build/Debug/Cygwin_4.x-Windows/main.o main.cpp
mkdir -p build/Debug/Cygwin_4.x-Windows
rm -f build/Debug/Cygwin_4.x-Windows/testsource.o.d
g++ -c -g -MMD -MP -MF build/Debug/Cygwin_4.x-Windows/testsource.o.d -o build/Debug/Cygwin_4.x-Windows/testsource.o testsource.cpp
mkdir -p dist/Debug/Cygwin_4.x-Windows
g++ -o dist/Debug/Cygwin_4.x-Windows/test build/Debug/Cygwin_4.x-Windows/main.o build/Debug/Cygwin_4.x-Windows/testsource.o
build/Debug/Cygwin_4.x-Windows/testsource.o: In function `main':
/cygdrive/c/Users/Familia/Documents/NetBeansProjects/test/testsource.cpp:4: multiple definition of `main'
build/Debug/Cygwin_4.x-Windows/main.o:/cygdrive/c/Users/Familia/Documents/NetBeansProjects/test/main.cpp:15: first defined here
collect2: error: ld returned 1 exit status
nbproject/Makefile-Debug.mk:63: recipe for target `dist/Debug/Cygwin_4.x-Windows/test.exe' failed
make[2]: *** [dist/Debug/Cygwin_4.x-Windows/test.exe] Error 1
make[2]: Leaving directory `/cygdrive/c/Users/Familia/Documents/NetBeansProjects/test'
nbproject/Makefile-Debug.mk:60: recipe for target `.build-conf' failed
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory `/cygdrive/c/Users/Familia/Documents/NetBeansProjects/test'
nbproject/Makefile-impl.mk:39: recipe for target `.build-impl' failed
make: *** [.build-impl] Error 2


CONSTRUIR FAILED (valor de saída 2, tempo total: 5s)
closed account (jwkNwA7f)
1
2
3
4
5
6
7
#include <iostream>
using namespace std;
int main()
{
    cout <<"I love my family";
    
    return 0;


You forgot to put the } at the end.

Hope this helped!
I have the curly bracket in my code. I think it got cut off in the process of copy and past to here.
Im not sure if its a compiler problem or not.
THe tutorial I did was super lame and easy.
I tried MINGW as well and I get the same errors.
Thanks anyways bro.
Last edited on
closed account (jwkNwA7f)
Well, the code looks fine to me.
thats why I thought it was a compiler problem. its just a few lines of code. and I went over it thoroughly.
I followed the cygwin install directions to the T. I tried uninstalling netbeans and cygwin and reinstalling still no love.
closed account (jwkNwA7f)
Yah, I ran it in VS and there was no errors.
So frustrating man, huahuah Im how am I supposed to learn the language if I cant even setup my packages. lolmaybe its local host problem.
my path was edited to C:\cygwin
closed account (jwkNwA7f)
I know what you mean.

That could be it. I have never used cygwin before. I have always used VS.
I tried switching to MINGW AGAIN. no love.
What a bunch of bologne #$%¨$&&¨*&()*)%#$%#$%
closed account (jwkNwA7f)
Are you using minGW with Code::Blocks

If you are than it may be possible you chose c instead of c++ when choosing the programming language.

I have to admit I have done this before.
Last edited on
Topic archived. No new replies allowed.