gmake [nbproject/Makefile-impl.mk:40: .build-impl] Error 2 - c++

I have an issue when building & running my application using NetBeans, this is a C++ project.
I'm using ubuntu :
Distributor ID: Ubuntu
Description: Ubuntu 22.04 LTS
Release: 22.04
Codename: jammy
Here is the error message :
> cd '/home/antoine/NetBeansProjects/CppApplication_1'
/usr/bin/gmake -f Makefile CONF=Debug
"/usr/bin/gmake" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
gmake[1]: Entering directory '/home/antoine/NetBeansProjects/CppApplication_1'
"/usr/bin/gmake" -f nbproject/Makefile-Debug.mk dist/Debug/GNU-Linux/cppapplication_1
gmake[2]: Entering directory '/home/antoine/NetBeansProjects/CppApplication_1'
gmake[2]: *** No rule to make target 'html_files/about.html.c', needed by 'build/Debug/GNU-Linux/html_files/about.html.o'. Stop.
gmake[2]: Leaving directory '/home/antoine/NetBeansProjects/CppApplication_1'
gmake[1]: *** [nbproject/Makefile-Debug.mk:63: .build-conf] Error 2
gmake[1]: Leaving directory '/home/antoine/NetBeansProjects/CppApplication_1'
gmake: *** [nbproject/Makefile-impl.mk:40: .build-impl] Error 2
BUILD FAILED (exit value 2, total time: 56ms)
I'm not really sure what I should include more so I'll add whatever you need.

Related

Regex code stopped working for no reason

Here's the code that I'm trying to build and compile. I'm not sure what I did, but this code worked before (a couple of weeks ago).
#include <regex>
using namespace std;
int main(int argc, char** argv) {
regex txt_regex("[a-z]+\\.txt");
return 0;
}
Here's the error log from netbeans:
cd '/home/dev/Desktop/test'
/usr/bin/make -f Makefile CONF=Debug
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory '/home/dev/Desktop/test'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/GNU-Linux/test
make[2]: Entering directory '/home/dev/Desktop/test'
mkdir -p build/Debug/GNU-Linux
rm -f "build/Debug/GNU-Linux/main.o.d"
g++ -c -g -std=c++11 -MMD -MP -MF "build/Debug/GNU-Linux/main.o.d" -o build/Debug/GNU-Linux/main.o main.cpp
In file included from /usr/include/c++/5/regex:60:0,
from main.cpp:1:
/usr/include/c++/5/bits/regex_compiler.h: In member function ‘bool std::__detail::_AnyMatcher<_TraitsT, false, __icase, __collate>::operator()(std::__detail::_AnyMatcher<_TraitsT, false, __icase, __collate>::_CharT) const [with _TraitsT = std::__cxx11::regex_traits<char>; bool __icase = true; bool __collate = false; std::__detail::_AnyMatcher<_TraitsT, false, __icase, __collate>::_CharT = char]’:
/usr/include/c++/5/bits/regex_compiler.h:292:7: internal compiler error: Segmentation fault
operator()(_CharT __ch) const
^
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-5/README.Bugs> for instructions.
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/dev/Desktop/test'
nbproject/Makefile-Debug.mk:59: recipe for target '.build-conf' failed
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory '/home/dev/Desktop/test'
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 1s)
What's going on?
The code works again after I updated my system:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade

NetBeans building failure | make Error 1

I get the following errors while building my project (game with C++/SFML):
cd '/home/osboxes/NetBeansProjects/Prueba'
/usr/bin/make -f Makefile CONF=Debug
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory '/home/osboxes/NetBeansProjects/Prueba'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/GNU-Linux/prueba
make[2]: Entering directory '/home/osboxes/NetBeansProjects/Prueba'
mkdir -p dist/Debug/GNU-Linux
g++ -o dist/Debug/GNU-Linux/prueba build/Debug/GNU-Linux/AABBCollidable.o build/Debug/GNU-Linux/AABBCollisionDetector.o build/Debug/GNU-Linux/AnimatedSprite.o build/Debug/GNU-Linux/Animation.o build/Debug/GNU-Linux/ConvexCollidable.o build/Debug/GNU-Linux/ConvexCollisionDetector.o build/Debug/GNU-Linux/ConvexShape.o build/Debug/GNU-Linux/Director.o build/Debug/GNU-Linux/Entry.o build/Debug/GNU-Linux/Event.o build/Debug/GNU-Linux/EventManager.o build/Debug/GNU-Linux/FileLogger.o build/Debug/GNU-Linux/GuiElement.o build/Debug/GNU-Linux/GuiSystem.o build/Debug/GNU-Linux/Label.o build/Debug/GNU-Linux/LabelButton.o build/Debug/GNU-Linux/ResourceManager.o build/Debug/GNU-Linux/State.o -L/usr/lib/x86_64-linux-gnu -lsfml-window -lsfml-system -lsfml-graphics -lsfml-audio
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o: In function `_start':
collect2: error: ld returned 1 exit status
nbproject/Makefile-Debug.mk:79: recipe for target 'dist/Debug/GNU-Linux/prueba' failed
make[2]: *** [dist/Debug/GNU-Linux/prueba] Error 1
make[2]: Leaving directory '/home/osboxes/NetBeansProjects/Prueba'
nbproject/Makefile-Debug.mk:76: recipe for target '.build-conf' failed
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory '/home/osboxes/NetBeansProjects/Prueba'
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 2s)
I have installed NetBeans IDE 8.1 with SFML libraries. I tried to fix it by clearing cache from NetBeans and then restart IDE but still does the same errors.
My project was compiled with Standard C++ compiler (C++11 version).
Hope you could help me. Thanks by the way...

My C++ DLL fails to compile except when I first open the project (in Netbeans)

I have a C++ DLL, something I have used several times. I use Netbeans, with MinGW.
I'm not sure when this began happening exactly, I made some small changes to the code and then began having problems. Basically, I can open Netbeans, open the project, execute a Clean and Build, and it passes, creating the DLL. However, if I try and do it again, it passes the clean, but fails the build. Here's the output from when it fails the second Clean and Build.
"/C/msys/1.0/bin/make.exe" -f nbproject/Makefile-Release.mk QMAKE= SUBPROJECTS= .clean-conf
make.exe[1]: Entering directory `absolute path here...'
rm -f -r build/Release
rm -f dist/Release/MinGW-Windows/myfile.dll
make.exe[1]: Leaving directory `absolute path here...'
CLEAN SUCCESSFUL (total time: 2s)
"/C/msys/1.0/bin/make.exe" -f nbproject/Makefile-Release.mk QMAKE= SUBPROJECTS= .build-conf
make.exe[1]: Entering directory `absolute path here...'
"/C/msys/1.0/bin/make.exe" -f nbproject/Makefile-Release.mk dist/Release/MinGW-Windows/myfile.dll
make.exe[2]: Entering directory `absolute path here...'
mkdir -p build/Release/MinGW-Windows
make.exe[2]: mkdir: Command not found
make.exe[2]: *** [build/Release/MinGW-Windows/Main.o] Error 127
make.exe[2]: Leaving directory `absolute path here...'
make.exe[1]: *** [.build-conf] Error 2
make.exe[1]: Leaving directory `absolute path here...'
make.exe": *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 2s)
Along with this, my DLL which had been executing without errors in my external program, now will not execute at all. I can't help but think the two issues are related. If I run it more times, I'll get a different message, which seems highly unusual...it cant execute a rm command?
"/C/msys/1.0/bin/make.exe" -f nbproject/Makefile-Release.mk QMAKE= SUBPROJECTS= .clean-conf
make.exe[1]: Entering directory `absolute path here...'
rm -f -r build/Release
make.exe[1]: rm: Command not found
make.exe[1]: Leaving directory `absolute path here...'
make.exe[1]: *** [.clean-conf] Error 127
make.exe": *** [.clean-impl] Error 2
CLEAN FAILED (exit value 2, total time: 1s)
If you need more information let me know, I'm pretty lost here so any help is appreciated. Thanks!
rm and mkdir are normally unix commands that have to be added to the PATH to make them work on windows.
Try going to the control panel, search for "environment" to open the environment panel and edit the PATH to add the directory for rm.exe and mkdir.exe (I am guessing C:\msys\1.0\bin).
After that you probably want to restart netbeans and any cmd shells you have open.

Unable to build NetBeans C/C++ Project

I just can't build a C/C++ project in NetBeans. The environment variable is properly set.
Error :
"/C/MinGW/msys/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make.exe[1]: Entering directory `/c/Users/Rahul/Documents/NetBeansProjects/CppApplication_1'
"/C/MinGW/msys/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk dist/Debug/MinGW-Windows/cppapplication_1.exe
make.exe[2]: Entering directory `/c/Users/Rahul/Documents/NetBeansProjects/CppApplication_1'
mkdir -p build/Debug/MinGW-Windows
make.exe[2]: mkdir: Command not found
make.exe[2]: *** [build/Debug/MinGW-Windows/main.o] Error 127
make.exe[2]: Leaving directory `/c/Users/Rahul/Documents/NetBeansProjects/CppApplication_1'
make.exe[1]: *** [.build-conf] Error 2
make.exe[1]: Leaving directory `/c/Users/Rahul/Documents/NetBeansProjects/CppApplication_1'
make.exe": *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 2s)
Code :
#include <stdio.h>
int main(void) {
printf("hello");
return 0;
}
NetBeans-1 :
NetBeans-2 :
The problem is that the "make" from msys looks for the msys mkdir but can't find it because you are not running in an msys environment.
The safe way to solve this is to launch NetBeans from the msys shell.
Alternatively you can manually create the directory as gcc/g++/... itself is also found on the path outside of an msys environment.

Error in C++ netbeans mkdir not found?

Everytime I try to build my c++ file I get this error
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory `/c/Users/Joey/Documents/NetBeansProjects/C++Train'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/MinGW-Windows/c__train.exe
make[2]: Entering directory `/c/Users/Joey/Documents/NetBeansProjects/C++Train'
make[2]: mkdir: Command not found
mkdir -p build/Debug/MinGW-Windows
make[2]: Leaving directory `/c/Users/Joey/Documents/NetBeansProjects/C++Train'
make[1]: Leaving directory `/c/Users/Joey/Documents/NetBeansProjects/C++Train'
make[2]: *** [build/Debug/MinGW-Windows/HelloWorld.o] Error 127
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 2s)
I checked the directory the make.exe was in and mkdir was there so I'm just baffled.
my code itself shows no errors:
#include <iostream>
int main() {
using namespace std;
cout << "Hello World!" << endl;
return 0;
}
Just a simple little hello world to test netbeans.
I guess you didn't add msys to your PATH variable. See this entry in the Netbeans forum(http://forums.netbeans.org/topic38061.html) So, the error message you received does not complain about make, it complains that it can't find mkdir, which is supposed to be in a directory in your msys directory. Adding C:\MinGW\msys\1.0\bin\ to your windows PATH variable will probably be sufficient to fix this.