Re: Why is Netbeans not compiling?

  • From: Paul Floyd < >
  • To:
  • Subject: Re: Why is Netbeans not compiling?
  • Date: Thu, 28 Feb 2013 23:07:23 +0100


On 28 Feb 2013, at 21:13, the5thace wrote:

> I followed this tutorial to get it running and C is being compiled. 
> http://www.youtube.com/watch?v=38kjxZIsJhw but c++ is not. I ran the stock ;
> c++ program and get this report. Interestingly I can't find a single IDE 
> that compiles for me. Even Dev-C will not compile for me.
> 
> "/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= 
> .build-conf
> make[1]: Entering directory 
> `/cygdrive/c/Users/Artur/Documents/NetBeansProjects/Portfolio1'
> "/usr/bin/make"  -f nbproject/Makefile-Debug.mk 
> dist/Debug/Cygwin-Windows/portfolio1.exe
> make[2]: Entering directory 
> `/cygdrive/c/Users/Artur/Documents/NetBeansProjects/Portfolio1'
> mkdir -p dist/Debug/Cygwin-Windows
> g++     -o dist/Debug/Cygwin-Windows/portfolio1 
> build/Debug/Cygwin-Windows/_ext/587805624/Portfolio_Program_1.o  
> build/Debug/Cygwin-Windows/_ext/587805624/Programming_practice.o  
> build/Debug/Cygwin-Windows/_ext/587805624/practice.o 
> build/Debug/Cygwin-Windows/_ext/587805624/Programming_practice.o: In 
> function `main':
> /cygdrive/c/Users/Artur/Documents/NetBeansProjects/Portfolio1/../Portfolio1/Programming
>  practice.cpp:3: multiple definition of `_main'
> build/Debug/Cygwin-Windows/_ext/587805624/Portfolio_Program_1.o:/cygdrive/c/Users/Artur/Documents/NetBeansProjects/Portfolio1/../Portfolio1/Portfolio
>  Program 1.c:4: first defined here
> build/Debug/Cygwin-Windows/_ext/587805624/practice.o: In function `main':
> /cygdrive/c/Users/Artur/Documents/NetBeansProjects/Portfolio1/../Portfolio1/practice.cpp:15:
>  multiple definition of `_main'
> build/Debug/Cygwin-Windows/_ext/587805624/Portfolio_Program_1.o:/cygdrive/c/Users/Artur/Documents/NetBeansProjects/Portfolio1/../Portfolio1/Portfolio
>  Program 1.c:4: first defined here
> collect2: ld returned 1 exit status
> nbproject/Makefile-Debug.mk:64: recipe for target 
> `dist/Debug/Cygwin-Windows/portfolio1.exe' failed
> make[2]: *** [dist/Debug/Cygwin-Windows/portfolio1.exe] Error 1
> make[2]: Leaving directory 
> `/cygdrive/c/Users/Artur/Documents/NetBeansProjects/Portfolio1'
> nbproject/Makefile-Debug.mk:61: recipe for target `.build-conf' failed
> make[1]: *** [.build-conf] Error 2
> make[1]: Leaving directory 
> `/cygdrive/c/Users/Artur/Documents/NetBeansProjects/Portfolio1'
> nbproject/Makefile-impl.mk:39: recipe for target `.build-impl' failed
> make: *** [.build-impl] Error 2

Hi

Your problem is not that you aren't compiling, rather it is that you are 
compiling too much. The error that you're getting is from the link editor, 
and it is not happy that you have two 'main' functions. (You must have only 
one).

You need to remove one of them, from either Programming_practice.cpp starting 
at line 3 or practice.cpp starting at line 15.

A+
Paul



Why is Netbeans not compiling?

the5thace 02/28/2013

Re: Why is Netbeans not compiling?

Paul Floyd 02/28/2013

Project Features

About this Project

CND was started in November 2009, is owned by Leonid Lenyashin, and has 130 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20140418.2d69abc). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close