Netbeans C++ trys a relative path for make.exe - c++

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.

Related

Dev-C++ giving error for Makefile.win and g++ stopping

I have installed Dev-C++, but when I make a C program and run it, it gives me an error, like:
C:\Users\Ved\Dev-Cpp\Makefile.win [Build Error] [Project1.exe] Error 1
And when I checked the log it shows the following:
Compiler: Default compiler
Building Makefile: "C:\Users\Ved\Dev-Cpp\Makefile.win"
Executing make...
make.exe -f "C:\Users\Ved\Dev-Cpp\Makefile.win" all
gcc.exe main.o -o "Project1.exe" -L"C:/Users/Ved/Dev-Cpp/lib"
gcc.exe: Internal error: Aborted (program collect2)
Please submit a full bug report.
See <URL:http://www.mingw.org/bugs.shtml> for instructions.
make.exe: *** [Project1.exe] Error 1
Execution terminated
I have used Dev-C++ on my friends computer running Windows XP SP3, and it runs fine and gives the output.
I am using Windows 8 64 bit, can I actually run Dev-C++ on 64 bit?
And can this error be fixed?
I have used the old Dev-C++ in the past and I've have had it break randomly on me at times..
Bloodshed Dev-C++ hasn't been updated for years and development has actually stopped on it.
If you really like the environment consider getting the updated and maintained Orwell Dev C++ that is improved, faster and much cleaner.
This is Solution to Solve error easily
Close All, then Go to Project options and in linker tab write the following and click ok:
-lopengl32
-lfreeglut
-lglu32
Now execute the program
Just close all the other tab in project. It will run normally
Check if in the compiler directory there is g++.exe.
If you can see it go to:
Installing c++/g++ on Windows
and download the file full.exe then follow the instruction and put the directory in path. After that restart your pc, go to the cmd and try to compile there. If it works change the toolchain of the IDE. If you need help contact me :)

NetBeans C++ Looking for make utility in the wrong location

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.

java.lang.NullPointer Exception when running C++ Programs in Netbeans 7.2

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.

Qt SDK 1.2.1 -- cannot find nmake

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.

Netbeans and MinGW-w64

I'm trying to configure my NetBeans on win7 64bit, to work with the MinGW-w64.
So I put in the %PATH% variable the following paths of the compiler:
C:\mingw-w64-bin_i686\mingw\bin
C:\minGw-MSYS\msys\bin
C:\mingw-w64-bin_i686\libexec\gcc\x86_64-w64-mingw32\4.7.0
Then I opened NetBeans and this was configured:
The configuration in NetBeans
I tried to compile a little test program but I received this error:
g++.exe: fatal error: -fuse-linker-plugin, but liblto_plugin-0.dll not
found compilation terminated. make[2]: *
[dist/Debug/MinGW-Windows/test.exe] Error 1 make1: [.build-conf]
Error 2 make: ** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 1s)
I do have this file in C:\mingw-w64-bin_i686\libexec\gcc\x86_64-w64-mingw32\4.7.0
what am I missing?
Right, after months of putting this off I've finally sat down and done it. I'll probably make a more detailed post on my blog with pretty pictures but here is a trimmed down SO version which will hopefully be enough for you (and everyone else) to get going with.
Prerequisites
Remove MinGW, MSYS and CMake if you have them and can afford to lose them (we will reinstall MinGW (obv.) and MSYS but not CMake as it doesn't appear to be needed.)
Netbeans or other suitable IDE
64bit Windows.
EnvMan (optional but handy for managing Windows Environment
variables.)
Installation
MinGW-W64 C compiler and MSYS
Download and install MinGW-W64
http://mingw-w64.sourceforge.net/ (link is on the left menu with a
hyperlink called 'WIN64 Downloads'.)
There are a lot of versions which can be a bit complicated. We are
going with mingw-w64-bin_i686-mingw_20111220 (although the numbers at
the end may be different) which basically says we want the version
with the windows binaries.
Once the download is complete (about 300mb so 10min or so) extract to
C:\MinGW-W64 or similar. Make sure there aren't any spaces in the
path!
Download MSYS for MinGW-W64
Took a bit of searching
http://sourceforge.net/apps/trac/mingw-w64/wiki/MSYS is the wiki for
it and
http://sourceforge.net/projects/mingw-w64/files/External%20binary%20packages%20%28Win64%20hosted%29/MSYS%20%2832-bit%29/
is where I found the download and the version I went with was
MSYS-20111123
Once the download is complete extract the files to C:\MSys or
similar. Make sure there aren't any spaces in the path!
Setup
Add 'C:\MinGW-W64\bin' to your Windows PATH variable.
Add 'C:\MSys\msys\bin' to your Windows PATH variable.
Start Netbeans and go to Tools -> Options -> C/C++.
Click 'Add' under 'Tool Collection' and select the base directory of
MinGW-W64 (C:\MinGW-W64\bin).
Select 'MinGW' from 'Tool Collection Family' if it isn't
auto-detected and click 'OK'.
Set the 'C Compiler to C:\MinGW-W64\bin\x86_64-w64-mingw32-gcc.exe.
Set the 'C++ Compiler to C:\MinGW-W64\bin\x86_64-w64-mingw32-g++.exe.
Set the 'Make Command' to C:\MSys\msys\bin\make.exe.
And that should be it!
I should note that I am using the system to compile a library file to be use via JNI so have some additional steps for that which I missed out as they weren't needed here. However I made a quick 'Hello World' program and it compiled and ran nicely.
Happy coding!
I have just downloaded the latest automated build, unzipped it, added the main bin directory to path, and run:
x86_64-w64-mingw32-gcc test.cpp -o test.exe
and
x86_64-w64-mingw32-gcc -fuse-linker-plugin test.cpp -o test.exe
and it works. The same for the i686 variant. Your IDE is doing something wrong. Or you shouldn't have messed with the files. Or you shouldn't have removed the prefixes. Seriously.
PS: You only have to add the main "bin" directory to PATH, all the rest is wrong.
With some searching via your favorite Internet search engine, I have come across a better approach to quickly add MinGW-x64 to a Windows 64-bit system. On the Sourceforge site is MSYS2.
While following the installation directions and obtaining the most up to date packages, there may be a time out at the primary mirror site on Sourceforge. If so, follow the mirror site update directions and update the three pacman text files in the respective MSYS2 directory (e.g. /etc/pacman.d). Then proceed to complete the package updates from the MSYS2 installation directions.
Within the MSYS2 packages are things like gcc, llvm, make, dmake, etc. Here is the command used from the MSYS2 command line shell (e.g. bash) to install the GNU make utility:
$ pacman -S msys/make
The executable location it will be placed is: /usr/bin inside the MSYS2 command shell. As far as configuring Netbeans for where make.exe is located, the Windows path is:
MSYS2 installation directory\usr\bin\make.exe
(e.g. C:\msys64\usr\bin\make.exe).
To successfully build C++ with Netbeans, I used the GNU make package (e.g. msys/make). Then in order to use the default make files that Netbeans manages, and to not interfere with other C++ compilers within your Windows installation (e.g. Visual Studio, Intel, CLang from Visual Studio, etc.), run Netbeans from the MinGW-x64 command shell provided by MSYS2. In this way, the environment variables and other things like:
ls rm mkdir
will indicate successful execution and compilation within the Netbeans internal terminal window. I opened the MinGW-w64 Win64 Shell by navigating to the installed shortcut from MSYS2's installation. Then pasted into the MinGW-x64 shell command line, the Target property value from the Netbeans Windows desktop shortcut:
$ "C:\Program Files (x86)\NetBeans 7.4\bin\netbeans.exe"
And then could finally create the respective debug and release object and executable files. I also modified the Netbeans project output to be within the MSYS2 directory structure. Then run the executable within the MSYS2 MinGW-x64 shell. Running from the Netbeans IDE produces this error message:
Unable to start pty process: The application failed with exit code
-1073741515 (0xc0000135).
If the MSYS2 path were in the computer system's PATH environment variable, then perhaps this error would not happen.