This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 233219 - Totally new programmer here, looking for help as to why Netbeans isn't working
Summary: Totally new programmer here, looking for help as to why Netbeans isn't working
Status: RESOLVED INVALID
Alias: None
Product: cnd
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: 7.3.1
Hardware: PC Windows 8
: P1 normal (vote)
Assignee: issues@cnd
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-22 23:07 UTC by yagipong
Modified: 2013-07-24 00:03 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description yagipong 2013-07-22 23:07:18 UTC
Hello, 

Yesterday I downloaded Cygwin 1.7.21-1, Java JDK 7u25, and Netbeans 7.3.1 onto my Toshiba which is running Windows 8. When I downloaded Cygwin I got the following resources: gcc, g++, gdb, and make. When I downloaded Netbeans I downloaded the biggest package, which included Java, C/C++, and a whole lot more. I ran the sample welcome program with no issue, but when I tried debugging the following programming: 

#include <cstdlib> 
#include <iostream> 
using namespace std; 

int main(int argc, char** argv) { 
std::cout << "Enter two numbers:" << std::endl; 
int v1 = 0, v2 = 0; 
std::cin >> v1 >>v2; 
std:cout << "The sum of" << v1 << "and" << v2 << "is" << v1 + v2 << std::endl; 
return 0; 
} 

I received this message: 

"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf 
make[1]: Entering directory `/cygdrive/c/Users/Yaw/Documents/NetBeansProjects/trial 1' 
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/Cygwin_4.x-Windows/trial_1.exe 
make[2]: Entering directory `/cygdrive/c/Users/Yaw/Documents/NetBeansProjects/trial 1' 
mkdir -p dist/Debug/Cygwin_4.x-Windows 
g++ -o dist/Debug/Cygwin_4.x-Windows/trial_1 build/Debug/Cygwin_4.x-Windows/main.o build/Debug/Cygwin_4.x-Windows/newmain.o 
build/Debug/Cygwin_4.x-Windows/newmain.o: In function `main': 
/cygdrive/c/Users/Yaw/Documents/NetBeansProjects/trial 1/newmain.cpp:14: multiple definition of `main' 
build/Debug/Cygwin_4.x-Windows/main.o:/cygdrive/c/Users/Yaw/Documents/NetBeansProjects/trial 1/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/trial_1.exe' failed 
make[2]: *** [dist/Debug/Cygwin_4.x-Windows/trial_1.exe] Error 1 
make[2]: Leaving directory `/cygdrive/c/Users/Yaw/Documents/NetBeansProjects/trial 1' 
nbproject/Makefile-Debug.mk:60: recipe for target `.build-conf' failed 
make[1]: *** [.build-conf] Error 2 
make[1]: Leaving directory `/cygdrive/c/Users/Yaw/Documents/NetBeansProjects/trial 1' 
nbproject/Makefile-impl.mk:39: recipe for target `.build-impl' failed 
make: *** [.build-impl] Error 2 


BUILD FAILED (exit value 2, total time: 1s) 

Netbeans says there is no error in the code itself, and I tried looking up answers but all the solutions I found either didn't help or I didn't understand what it was saying. Can someone please tell me what the problem is here? 

Thanks!
Comment 1 Andrew Krasny 2013-07-23 05:55:43 UTC
yagipong,

it's better to use forum for questions like this [https://forums.netbeans.org/cnd-users.html].

In your case the problem is "multiple definition of `main'". There should be only one.
Comment 2 yagipong 2013-07-24 00:03:13 UTC
Hi Andrew,

Thanks for the response, how do I make only 1 definition for main?

Thanks
yagipong
(In reply to comment #1)
> yagipong,
> 
> it's better to use forum for questions like this
> [https://forums.netbeans.org/cnd-users.html].
> 
> In your case the problem is "multiple definition of `main'". There should be
> only one.