May 6, 2018 at 8:36pm UTC
I'm running Netbeans on Linux Mint. I'm trying to figure out how to create a hello world in Netbeans. I went into Tools --> Plugins and enabled c\c++. I start the project by selecting new project --> c++ --> C++ application. Then next my way though there. the next screen, it asks about a make file and I select c++. Then if I finish the wizard and then open main.cpp and enter in code...
#include "stdafx.h"
#include<iostream>
int main()
{
std::cout << "Hello World" << std::endl;
return 0;
}
I get the compilation error...
cd '/home/david/NetBeansProjects/CppApplication_1'
/usr/bin/make -f Makefile CONF=Debug
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory '/home/david/NetBeansProjects/CppApplication_1'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/GNU-Linux/cppapplication_1
make[2]: Entering directory '/home/david/NetBeansProjects/CppApplication_1'
mkdir -p build/Debug/GNU-Linux
rm -f "build/Debug/GNU-Linux/main.o.d"
gcc -c -g -MMD -MP -MF "build/Debug/GNU-Linux/main.o.d" -o build/Debug/GNU-Linux/main.o main.cpp
gcc: error trying to exec 'cc1plus': execvp: No such file or directory
nbproject/Makefile-Debug.mk:66: recipe for target 'build/Debug/GNU-Linux/main.o' failed
make[2]: *** [build/Debug/GNU-Linux/main.o] Error 1
make[2]: Leaving directory '/home/david/NetBeansProjects/CppApplication_1'
nbproject/Makefile-Debug.mk:59: recipe for target '.build-conf' failed
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory '/home/david/NetBeansProjects/CppApplication_1'
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 118ms)
May 6, 2018 at 8:44pm UTC
Ok, it always happens. I post the question and then figure it out. I didn't figure out the above. But I figured out how to use g++ compiler.
I just wrote my code in vi, then g++ the code and ran a.out.
I did have to get rid of #include "stdafx.h"
May 6, 2018 at 8:45pm UTC
Still would like to have netbeans for syntax highlighting.
May 6, 2018 at 11:03pm UTC
Last edited on May 6, 2018 at 11:03pm UTC