Discussion:
C/C++ Bug????
soldatov
2014-04-29 07:48:23 UTC
Permalink
You missed:
#include <iostream>
SomeGuy
2014-04-29 07:38:08 UTC
Permalink
Hello Again! I Installed Netbeans 8.0 with JDK 8u5 Cobundle in my Desktop now, But Again No LUCK at all!!!

The Same Problem as before appears!

Is there any way you can run C++ projects in Netbeans???? please reply if anyone has managed this!

#include <cstdlib>

using namespace std;

/*
*
*/
int main(int argc, char** argv) {
cout << "Hello World!" << endl;

return 0;
}

and keeps showing:

"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory `/home/pankalos/NetBeansProjects/HelloWorldCpp'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/GNU-Linux-x86/helloworldcpp
make[2]: Entering directory `/home/pankalos/NetBeansProjects/HelloWorldCpp'
mkdir -p build/Debug/GNU-Linux-x86
rm -f "build/Debug/GNU-Linux-x86/main.o.d"
g++ -c -g -MMD -MP -MF "build/Debug/GNU-Linux-x86/main.o.d" -o build/Debug/GNU-Linux-x86/main.o main.cpp
main.cpp: In function ‘int main(int, char**)’:
main.cpp:16:5: error: ‘cout’ was not declared in this scope
main.cpp:16:31: error: ‘endl’ was not declared in this scope
make[2]: *** [build/Debug/GNU-Linux-x86/main.o] Error 1
make[2]: Leaving directory `/home/pankalos/NetBeansProjects/HelloWorldCpp'
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory `/home/pankalos/NetBeansProjects/HelloWorldCpp'
make: *** [.build-impl] Error 2

BUILD FAILED (exit value 2, total time: 247ms)
LAW Andy
2014-04-29 08:27:07 UTC
Permalink
I'll try to help…
From your error messages it looks as if Netbeans is running just fine. It passes control to 'make' which launches 'g++' and passes it the name of the source file and all the other stuff. Then it reports an error which comes from g++ (not from Netbeans).
I'm going to presume that you're new to C++ as well as NetBeans?

Try googling using the error string that you get back. Then see if you can spot a problem with your code.

Hope that helps.

Later,

Andy
Hello Again! I Installed Netbeans 8.0 with JDK 8u5 Cobundle in my Desktop now, But Again No LUCK at all!!!
The Same Problem as before appears!
Is there any way you can run C++ projects in Netbeans???? please reply if anyone has managed this!
#include <cstdlib>
using namespace std;
/*
*
*/
int main(int argc, char** argv) {
cout << "Hello World!" << endl;
return 0;
}
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory `/home/pankalos/NetBeansProjects/HelloWorldCpp'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/GNU-Linux-x86/helloworldcpp
make[2]: Entering directory `/home/pankalos/NetBeansProjects/HelloWorldCpp'
mkdir -p build/Debug/GNU-Linux-x86
rm -f "build/Debug/GNU-Linux-x86/main.o.d"
g++ -c -g -MMD -MP -MF "build/Debug/GNU-Linux-x86/main.o.d" -o build/Debug/GNU-Linux-x86/main.o main.cpp
main.cpp:16:5: error: ‘cout’ was not declared in this scope
main.cpp:16:31: error: ‘endl’ was not declared in this scope
make[2]: *** [build/Debug/GNU-Linux-x86/main.o] Error 1
make[2]: Leaving directory `/home/pankalos/NetBeansProjects/HelloWorldCpp'
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory `/home/pankalos/NetBeansProjects/HelloWorldCpp'
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 247ms)
--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.
SomeGuy
2014-04-29 10:17:03 UTC
Permalink
OOHH My god!!! THANK you very very much!!! You made my day! I didnt realise that it was missing!! thanks again dude!
Loading...