I am running on a Windows 7 64 laptop
And trying to develop C++ with NetBeans.
I really know very little about makefiles or cygwin or this whole ecosystem, so it is a mystery to me.
Least year I installed NetBeans (8.0) it worked fine.
Yesterday I tried to use it but it seems to have stopped working.
Possibly this is because I tried a lot of things to try to get NDK development to work for Eclipse and moved things and or changed critical system variables.
I failed in this but probably messed up my system still farther.
I tried to install the new version of NetBeans (8.1) and I got all sorts of messages about the JDK.
Despite fighting with that for a few hours I was unable to fix these messages however it seems to let me open a simple program and try to compile it but the compile fails yet again.
Since the last time I used NetBeans I also installed, among other things, Visual C++ 2015 (at least this worked for the NDK work).
Help !
int main(int argc, char** argv) {
return 0;
}
When I press the hammer and broom icon (clean and compile) I get these error messages:
"/C/MinGW/MSYS/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk QMAKE=
SUBPROJECTS= .clean-conf
make.exe[1]: Entering directory `/c/Users/Andre/Documents/NetBeansProjects/hello compiler'
rm -f -r build/Debug
rm -f dist/Debug/MinGW-Windows/hello_compiler.exe
make.exe[1]: Leaving directory `/c/Users/Andre/Documents/NetBeansProjects/hello compiler'
CLEAN SUCCESSFUL (total time: 853ms)
"/C/MinGW/MSYS/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make.exe[1]: Entering directory `/c/Users/Andre/Documents/NetBeansProjects/hello compiler'
"/C/MinGW/MSYS/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk dist/Debug/MinGW-Windows/hello_compiler.exe
make.exe[2]: Entering directory `/c/Users/Andre/Documents/NetBeansProjects/hello compiler'
mkdir -p build/Debug/MinGW-Windows
rm -f "build/Debug/MinGW-Windows/main.o.d"
g++ -c -g -MMD -MP -MF "build/Debug/MinGW-Windows/main.o.d" -o build/Debug/MinGW-Windows/main.o main.cpp
make.exe[2]: *** [build/Debug/MinGW-Windows/main.o] Error 1
make.exe[2]: Leaving directory `/c/Users/Andre/Documents/NetBeansProjects/hello compiler'
make.exe[1]: *** [.build-conf] Error 2
make.exe[1]: Leaving directory `/c/Users/Andre/Documents/NetBeansProjects/hello compiler'
make.exe": *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 960ms)
Does anyone even know how to interpret this output?
Thanks
Andre'
As commented by M.M, MinGw doesn't support blanks in path names. Using a path without such should work.
Related
I'm trying to use GMP in Netbeans on Windows. The build fails giving the output:
cd 'C:\Users\dev1\Documents\NetBeansProjects\Simple Test'
C:\MinGW\msys\1.0\bin\make.exe -f Makefile CONF=Debug
"/C/MinGW/msys/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make.exe[1]: Entering directory `/c/Users/dev1/Documents/NetBeansProjects/Simple Test'
"/C/MinGW/msys/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk dist/Debug/MinGW-Windows/simple_test.exe
make.exe[2]: Entering directory `/c/Users/dev1/Documents/NetBeansProjects/Simple Test'
mkdir -p dist/Debug/MinGW-Windows
g++ -o dist/Debug/MinGW-Windows/simple_test build/Debug/MinGW-Windows/main.o
build/Debug/MinGW-Windows/main.o: In function `ZN17__gmp_binary_plus4evalEP12__mpz_structPKS0_m':
c:/mingw/include/gmpxx.h:196: undefined reference to `__gmpz_add_ui'
build/Debug/MinGW-Windows/main.o: In function
c:/mingw/include/gmpxx.h:1497: undefined reference to `__gmpz_init'
//...same thing
collect2.exe: error: ld returned 1 exit status
make.exe[2]: *** [dist/Debug/MinGW-Windows/simple_test.exe] Error 1
make.exe[2]: Leaving directory `/c/Users/dev1/Documents/NetBeansProjects/Simple Test'
make.exe[1]: *** [.build-conf] Error 2
make.exe[1]: Leaving directory `/c/Users/dev1/Documents/NetBeansProjects/Simple Test'
make.exe": *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 2s)
Here are the settings I changed in Netbeans and guess where the error lies
How can I get GMP to work so I can use it in my source code?
It's definitely a setting on Netbeans as I can compile it from the command line with g++ test.cpp -o test.exe -lgmpxx -lgmp
Got this answer from mathGl / MinGW undefined reference Netbeans IDE
right click on project and go to properties
in the left pane select linker
click the "..." beside libraries
click "add option"
select "other option" and type in -lgmpxx -lgmp
click ok
Should now see...
I'm trying to build a simple vulkan example with Netbeans 8.0.2 using MinGW64 5.3.0. But for some reason, it doesn't seem to want to find the glf3.dll file even though the dependency locations and file names have been specified in the linker options.
Error message:
C:\Tools\MinGW\msys\1.0\bin\make.exe -f Makefile CONF=Debug
"/C/Tools/MinGW/msys/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make.exe[1]: Entering directory `/c/Users/gkovalechyn/Documents/NetBeansProjects/VulkanTests'
"/C/Tools/MinGW/msys/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk dist/Debug/MinGW_64-Windows/vulkantests.exe
make.exe[2]: Entering directory `/c/Users/gkovalechyn/Documents/NetBeansProjects/VulkanTests'
mkdir -p build/Debug/MinGW_64-Windows
rm -f "build/Debug/MinGW_64-Windows/main.o.d"
g++ -m64 -std=c++11 -c -g -I../../../../../Libraries/glm -I../../../../../Libraries/glfw-3.2.bin.WIN64/include -I../../../../../Tools/VulkanSDK/1.0.17.0/Include -MMD -MP -MF "build/Debug/MinGW_64-Windows/main.o.d" -o build/Debug/MinGW_64-Windows/main.o main.cpp
make.exe[2]: *** No rule to make target `glfw3.dll', needed by `dist/Debug/MinGW_64-Windows/vulkantests.exe'. Stop.
make.exe[2]: Leaving directory `/c/Users/gkovalechyn/Documents/NetBeansProjects/VulkanTests'
make.exe[1]: *** [.build-conf] Error 2
make.exe[1]: Leaving directory `/c/Users/gkovalechyn/Documents/NetBeansProjects/VulkanTests'
make.exe": *** [.build-impl] Error 2
Linker settings:
Proof that the DLL exists in that folder:
Solved it myself. I had to tell Netbeans the exact path to the libraries instead of adding them as additional dependencies.
So basically, go to the project properties, Build -> Linker -> Libraries. From there add the libraries FILES, not the library and it should work.
I'm in the final stages (I hope) of porting an old Windows XP C/C++ program to LINUX. I edited and tested a C++ class in the file DateTime.cpp. In my test project it worked so I applied the edits to my working project. When I make the project I get an error that I don't understand:
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory `/home/programmer/NetBeansProjects/Flight4'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/GNU-Linux-x86/flight4
make[2]: Entering directory `/home/programmer/NetBeansProjects/Flight4'
mkdir -p build/Debug/GNU-Linux-x86
rm -f "build/Debug/GNU-Linux-x86/DateTime.o.d"
g++ -ffreestanding -c -include /usr/local/include -MMD -MP -MF "build/Debug/GNU-Linux-x86/DateTime.o.d" -o build/Debug/GNU-Linux-x86/DateTime.o DateTime.cpp
cc1plus: fatal error: /usr/local/include: No such file or directory
compilation terminated.
/usr/local/include exists; DateTime.cpp and DateTime.hpp are in the local project directory
/home/programmer/NetBeansProjects/Flight4
The project uses a couple of .so libraries in /usr/local/lib with their header files in /usr/local/include.
I've not coded in C/C++ for about 5 years now and when I did I used a RAD so I'm not skilled with makefiles.
Edit: Etan's comment was right on the button: I had added /usr/local/bin to the wrong spot in the properties wizard. Moving it to the correct field in the NetBeans Properties wizard fixed the problem.
I used the precompiled version of GLFW for windows. I use netbeans and i can't resolve this error.
"/E/Develop/Util/msys/bin/make.exe" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make.exe[1]: Entering directory `/e/Develop/Project/Netbeans/C++/CppApplication_1'
"/E/Develop/Util/msys/bin/make.exe" -f nbproject/Makefile-Debug.mk dist/Debug/MinGW-w64_x64_-posix-seh-Windows/cppapplication_1.exe
make.exe[2]: Entering directory `/e/Develop/Project/Netbeans/C++/CppApplication_1'
mkdir -p build/Debug/MinGW-w64_x64_-posix-seh-Windows
rm -f "build/Debug/MinGW-w64_x64_-posix-seh-Windows/main.o.d"
g++ -c -g -I/E/Develop/Library/C++/GLFW\ 3.0.4/include -MMD -MP -MF "build/Debug/MinGW-w64_x64_-posix-seh-Windows/main.o.d" -o build/Debug/MinGW-w64_x64_-posix-seh-Windows/main.o main.cpp
mkdir -p dist/Debug/MinGW-w64_x64_-posix-seh-Windows
g++ -o dist/Debug/MinGW-w64_x64_-posix-seh-Windows/cppapplication_1 build/Debug/MinGW-w64_x64_-posix-seh-Windows/main.o -L../../../../Library/C++/GLFW\ 3.0.4/lib-mingw -L../../../../Compiler/C++/MinGW-w64\(x64\)-posix-seh/x86_64-w64-mingw32/lib -lglfw3 -lglfw3dll
e:/Develop/Compiler/C++/MinGW-w64(x64)-posix-seh/bin/../lib/gcc/x86_64-w64-mingw32/4.9.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lglfw3dll
collect2.exe: error: ld returned 1 exit status
make.exe[2]: *** [dist/Debug/MinGW-w64_x64_-posix-seh-Windows/cppapplication_1.exe] Error 1
make.exe[2]: Leaving directory `/e/Develop/Project/Netbeans/C++/CppApplication_1'
make.exe[1]: *** [.build-conf] Error 2
make.exe[1]: Leaving directory `/e/Develop/Project/Netbeans/C++/CppApplication_1' make.exe": *** [.build-impl] Error 2
i add the directory and linked the Libraries like this
this is the code
how can i fix this?
The GLFW has two versions of libraries - static and dynamic (DLL). If you want to link with the static library, then you won't have to include the glfw3dll (which is a DLL link library) into the list of libraries. Please see the Building programs that use GLFW for more info. They also mention other libraries you need to link to.
I'm trying to set up C++11 in Netbeans 7.3, however I seem to have hit a wall. The error I'm getting is the same as in the title:
cc1plus.exe: error: unrecognized command line option '-std=c++11'
I have installed G++ 4.7.1 (which should support C++11) and have followed instructions this thread here:
Why doesn't Netbeans recognize `cbegin()`, `cend()`, `unordered_set`, among other C++ features?
Here's the console dump:
"/C/MinGW/msys/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .clean-conf
make.exe[1]: Entering directory `/c/Users/Nikola/Documents/NetBeansProjects/heap'
rm -f -r build/Debug
rm -f dist/Debug/MinGW_11-Windows/heap.exe
make.exe[1]: Leaving directory `/c/Users/Nikola/Documents/NetBeansProjects/heap'
CLEAN SUCCESSFUL (total time: 654ms)
"/C/MinGW/msys/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make.exe[1]: Entering directory `/c/Users/Nikola/Documents/NetBeansProjects/heap'
"/C/MinGW/msys/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk dist/Debug/MinGW_11-Windows/heap.exe
make.exe[2]: Entering directory `/c/Users/Nikola/Documents/NetBeansProjects/heap'
mkdir -p build/Debug/MinGW_11-Windows
rm -f build/Debug/MinGW_11-Windows/main.o.d
g++ -c -g -std=c++11 -MMD -MP -MF build/Debug/MinGW_11-Windows/main.o.d -o build/Debug/MinGW_11-Windows/main.o main.cpp
cc1plus.exe: error: unrecognized command line option '-std=c++11'
make.exe[2]: *** [build/Debug/MinGW_11-Windows/main.o] Error 1
make.exe[2]: Leaving directory `/c/Users/Nikola/Documents/NetBeansProjects/heap'
make.exe[1]: *** [.build-conf] Error 2
make.exe[1]: Leaving directory `/c/Users/Nikola/Documents/NetBeansProjects/heap'
make.exe": *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 1s)
I'm running Netbeans on Windows by the way.
Change -std=c++11 to -std=c++0x.