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.
Related
I'm building a Qt5 (installed through vcpkg) project on macOS.
It builds nicely on QtCreator, debug mode. But when I try to build it from command line, also debug mode, then I get
make: *** No rule to make target `/Users/user/vcpkg/installed/x64-osx/lib/libQt5PrintSupport_debug.a', needed by `project.app/Contents/MacOS/project'. Stop.
I see libQt5PrintSupport_debug.a installed at
vcpkg/installed/x64-osx/debug/lib/libQt5PrintSupport_debug.a
So might be that when things are done from command line vcpkg/installed/x64-osx/debug/lib/ is not being searched, I guess.
How can I add this to the searched path list?
Is there a specific environment variable on macOS where .a are searched?
Building in release mode from command line works fine.
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
Today I tried to compile a c++ program in Eclipse CDT for the first time, and the error that is came up was Program "make" not found in PATH , so I searched on google for the problems and I have found many similar solution to my problem, but no problem was like my one.
First I tried to reset the enviroment variables, but nothing changed, and then I uninstalled Mingw and reinstalled following this instruction, and using the command gcc --version it says that it is well installed. the next step is installing MYSYl, and checking the installation with the command mingw32-make gives
mingw32-make: *** No targets specified and no makefile found. Stop.
Instead of No Target Specified, but in an other answer on stackoverflow it's said that this means that it works. So I continued following the guide, and at the end, when I build my helloword project I get two errors:
mingw32-make: *** [all] Error 1
recipe for target 'all' failed
I can't find where I did wrong searching on google, can you suggest it me?
Another thing, if I go on Eclipse in Window->Preference->c/C++->Build->Enviroment there are no variable there, how can I add Mingw there?
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.
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.