I wanted to try my hands on C++ and wanted to use the same netbeans IDE since I have being using it for sometime for Java development. I downloaded the Cygwin tools and set up the IDE accordingly.
When I try to run the application it says that the build was successful...,
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory `/cygdrive/c/Users/LJee/netbeans/tut-install/CppApplication_1'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/Cygwin-Windows/cppapplication_1.exe
make[2]: Entering directory `/cygdrive/c/Users/LJee/netbeans/tut-install/CppApplication_1'
make[2]: `dist/Debug/Cygwin-Windows/cppapplication_1.exe' is up to date.
make[2]: Leaving directory `/cygdrive/c/Users/LJee/netbeans/tut-install/CppApplication_1'
make[1]: Leaving directory `/cygdrive/c/Users/LJee/netbeans/tut-install/CppApplication_1'
BUILD SUCCESSFUL (total time: 450ms)
But the program will not run. It throws a Java Null pointer exception.
java.lang.NullPointerException
RUN FAILED (exit value -1, total time: 26ms)
Since there are no Java code in C++ programs this has to be an issue with the IDE. I saw this thread in the Netbeans forum
http://forums.netbeans.org/topic52231.html
Here the user has changed the IDE version which I don't want to do.
Is there anyone out there who has come across this situation who can help me out. I'll be glad!
Thanks in advance!!
I had the same problem under Linux Mint 18 Cinnamon with Netbeans 8.1 and I solved it by right-click the project name item -> Properties -> Run -> Console Type -> "Standard output"
After that the "Run" command worked perfect.
I found the solution you have to add the Cygwin path (C:\cygwin\bin) to the environment path variable then it works fine? Look at link https://netbeans.org/community/releases/72/cpp-setup-instructions.html#compilers
I encountered the same issue when I upgraded Ubuntu from 14.04 LTS to 16.04 LTS and upgraded NetBeans IDE from 8.0.2 to 8.1 via Synaptic.
I guess my JVM installation was messed up.
My solution was to uninstall NetBeans 8.1 with Synaptic and then download and install the same version 8.1 from https://netbeans.org/downloads/ (all-in installer). It fixed the issue.
Related
I'm trying to build Google Test with MSYS and MinGW with the help of this page.
I have MinGW and MSYS installed on MS Windows 10 Home. So far I've run these commands in the MSYS terminal, in the Google Test source code directory:
mkdir build
cd build
cmake -G "MSYS Makefiles" ..
make
The make command fails with this output:
In file included from c:/MinGW/msys/1.0/home/mkkek/googletest-release-1.10.0/googletest/src/gtest-all.cc:41:
C:/MinGW/msys/1.0/home/mkkek/googletest-release-1.10.0/googletest/src/gtest.cc:86:11: fatal error: crtdbg.h: No such file or directory
86 | # include <crtdbg.h> // NOLINT
| ^~~~~~~~~~
compilation terminated.
make[2]: *** [googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.obj] Error 1
make[1]: *** [googletest/CMakeFiles/gtest.dir/all] Error 2
make: *** [all] Error 2
crtdbg.h seems to be a Visual C++ header file. I do have the Windows 10 SDK and Visual C++ installed, but the build system isn't finding the headers.
I've read this thread, but none of the tips there have helped.
I'd appreciate any help.
I switched to MSYS2 as was suggested in the comments, and I managed to successfully build the library.
I followed the directions that are on the project home page to install MSYS2.
With MSYS2, the mingw-w64-x86_64-gtest package can be directly installed in order to use Google Test.
pacman -S mingw-w64-x86_64-gtest
I copied/paste a Qt5 project folder from a computer to another computer. They are both Ubuntu 18.04.
Same version of Qt5 and same libraries/dependencies. On the new computer, I have CMake 3.10.2, but I don't remember the verion of CMake I had on the former one. (Probably CMake 3.8).
As soon as I open Qt5 and open the folder containing the CMakeLists.txt file, and click on it, I get the following result from the output:
08:02:22: Running steps for project newcam-proc...
08:02:22: Persisting CMake state...
08:02:22: Starting: "/usr/bin/snap" --build . --target all error: unknown flag `build'
08:02:22: The process "/usr/bin/snap" exited with code 1.
Error while building/deploying project myProject (kit: Desktop Qt 5.12.5 GCC 64bit)
The kit Desktop Qt 5.12.5 GCC 64bit has configuration issues which might be the root cause for this problem. When executing step "CMake Build"
08:02:22: Elapsed time: 00:00.
And below the General Message I get:
Project ERROR: You need to set the ANDROID_NDK_ROOT environment variable to point to your Android NDK.
Could not read qmake configuration file /home/emanuele/Qt/5.12.5/android_armv7/mkspecs/android-clang/qmake.conf.
Project ERROR: You need to set the ANDROID_NDK_ROOT environment variable to point to your Android NDK.
Could not read qmake configuration file /home/emanuele/Qt/5.12.5/android_x86/mkspecs/android-clang/qmake.conf.
Running /usr/bin/snap /home/emanuele/Desktop/myProject -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_CXX_COMPILER:STRING=/usr/bin/g++ -DCMAKE_C_COMPILER:STRING=/usr/bin/gcc -DCMAKE_PREFIX_PATH:STRING=/home/emanuele/Qt/5.12.5/gcc_64 -DQT_QMAKE_EXECUTABLE:STRING=/home/emanuele/Qt/5.12.5/gcc_64/bin/qmake in /tmp/QtCreator-vlHbHY/qtc-cmake-LvUefYdh.
error: unknown command "/home/emanuele/Desktop/myProject", see 'snap help'.
CMake process exited with exit code 1.
I never had to use Android NDK on my previous project, nor I had to install it. And I am not sure why on the new machine is showing this message.
In addition it seems that is trying to use snap instead of the usual make.
I am not sure about what is happening and why.
What I tried so far:
1) The only thing that came to my mind was to try to create a small example application and see if it runs, it actually runs properly and gives no error as shown below:
08:16:00: Running steps for project untitled...
08:16:00: Configuration unchanged, skipping qmake step.
08:16:00: Starting: "/usr/bin/make" -j8
make: Nothing to be done for 'first'.
08:16:00: The process "/usr/bin/make" exited normally.
08:16:00: Elapsed time: 00:00.
It seems that the project that I copied/paste uses snap and if I create a new project, like a Qt Widget application, it actually uses make, exiting correctly in the output.
The flags --build . --target all are flags you typically see passed to the cmake executable, not the snap executable. This hints that your CMake environment is not configured correctly in the IDE on your new machine. I suggest following the QtCreator CMake setup instructions here to help get it configured:
To specify paths to CMake executables:
Select Tools > Options > Kits > CMake > Add.
In the Name field, specify a name for the tool.
In the Path field, specify the path to the CMake executable.
Select the Auto-create build directories check box to automatically create build directories for CMake projects.
Select Apply to save your changes.
My issue here is that I have all the proper compilers for C, C++, etc installed (MinGW), and they are functioning properly but Netbeans will not acces the make.exe util. I reinstalled NetBeans C++ because my last install became corrupted, and I now get this error whenever I build a project:
"/c/Users/User/Dropbox/C++ Workspace/Project/"C:/MinGW/msys/1.0/bin/make.exe"" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
/bin/sh: /c/Users/User/Dropbox/C++ Workspace/Project/C:/MinGW/msys/1.0/bin/make.exe: No such file or directory
make.exe": *** [.build-impl] Error 127
BUILD FAILED (exit value 2, total time: 303ms)
The solution to this problem seems trivial because NetBeans is looking for the make.exe util in the wrong location. The last part of the url it is searching for is correct, but it appears as though it is appending the project's location to the beginning of it. I may be wrong though. Does anyone know why NetBeans is doing this and/or how I can go about fixing it? Thanks!
Also, I tried the solution posted here, but I was never referencing any other version of the make utility except the MinGW one.
I have exactly the same problem with NetBeans IDE 7.3 and MinGW in that the pathname for the make file is concatenated with the project folder name; as a result the make file can not be found. After much agonizing trial and error, I finally got it working, at least for the Welcome_1 example supplied by NetBeans and my own original project that I was working on.
Remember when you first set up NetBeans it told you that mingw32-make.exe under C:\MinGW\bin is incompatible and asked you to use the make.exe under C:\MinGW\msys\1.0\bin ? It turned out it is the latter that's incompatible. I made a copy of mingw32-make.exe , renamed it make.exe (otherwise NetBeans refuses to use it) , updated the tool collection accordingly and voila it worked "BUILD SUCCESSFUL".
Hope this will help others in the future.
Update: just installed NetBeans IDE 7.3.1 and now "/C/MinGW/msys/1.0/bin/make.exe" works fine. So this appears to be a bug in NetBeans 7.3 that's fixed in 7.3.1. Hope this helps.
I've had excact same problem. Tried the way one post up, but it didn't solve my problem. By the way, main project compiled, but test did not (I use google test 1.7.0). I resolved this problem by downgrading JDK 7 and JRE 7 to update 17. You can download it from Oracle website. Here's a link: http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase7-521261.html
Sorry for my English.
I recently reinstalled Windows on one PC but I'm failing in reinstalling Netbeans C++ with MinGw/Msys and Qt 4.8.3. Everytime I try to build a error message like this comes up:
"/d/Eigene Dateien/Dokumente/NetBeansProjects/Test_1/"C:/msys/1.0/bin/make.exe"" -f nbproject/Makefile-Debug.mk QMAKE=/C/Qt/4.8.3/bin/qmake.exe SUBPROJECTS= .build-conf
/bin/sh.exe: /d/Eigene Dateien/Dokumente/NetBeansProjects/Test_1/C:/msys/1.0/bin/make.exe: No such file or directory
make.exe": *** [.build-impl] Error 127
BUILD FAILED (exit value 2, total time: 964ms)
It seems for me that it trys to execute the commands relativly to the project path. On my laptop I did everything same when I installed Netbeans 7.2.1 (now it's 7.3, maybe cause of that?) and hadn't this issue.
This is a bug caused by Java 7u21 in Netbeans 7.3. See https://netbeans.org/bugzilla/show_bug.cgi?id=228730. One workaround, if you do not want to upgrade (although I don't see why anyone would not want to upgrade) is to add msys' bin directory to the path, and then use make.exe as the command for make (as opposed to C:\msys\bin\make.exe or wherever it is installed).
That being said, the best solution is to just upgrade to Netbeans 7.3.1, where the bug seems to be fixed, along with many more bugs.
If there is no make.exe in C:\msys\1.0\bin you should use ?:\minGW\bin\make.exe.
ALso your Netbeans Options should have the path to the make exe.
If you have your path rigth configured (you can open your console and execute make.exe form anywhere on the path) you can put just "make.exe" (without path) on "Make Command" option in C/C++ netbean configuration.
EDIT: It seems I can use the nmake from \Microsoft Visual Studio 10.0\VC\bin\nmake.exe, but it would be nice (and much more user-friendly) if the "Qt 4.8.1 for Desktop" took care of this automatically.
I installed Qt SDK under Windows 7, 64 bit, using the online installer. I used the default installation options.
Now I am trying to build the Notepad app under \QtSDK\Examples\4.7\tutorials\gettingStarted\gsQt. I am using the supplied "Qt 4.8.1 for Desktop" command line.
For the first two steps of the build, qmake runs perfectly, but then nmake cannot be found in my installation. It's not a problem of setting a path -- I cannot find nmake.exe (or anything resembling nmake) anywhere in the QtSDK folder and subfolders.
If I use make or mingw32-make, I get the famous missing separator error:
c:/qtsdk/mingw/bin/mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory `C:/Workspace/qt_notepad'
Makefile.Debug:59: *** missing separator. Stop.
mingw32-make[1]: Leaving directory `C:/Workspace/qt_notepad'
mingw32-make: *** [debug] Error 2
Is this a buggy installation, or am I overlooking something?
nmake is release with MSVC toolchain. Hence, you can not find it in the QtSDK.
This is for you reference.