so while trying to assist a friend in setting up QT I ran into a odd problem with his system. Whenever he attempts to build a simple 'Hello World' app through QTCreator using all the default settings, he gets some odd compiler output diffrent to my own. I know for a fact that his install, and project setup was done verbatim exactly as I did it, I even had him uninstall and reinstall along side me to test that.
Everything with QtCreator works out of the box on my end, and I after a few hours of uninstalling / reinstalling on both machines via remote control I am out of ideas.
HIS COMPILER OUTPUT
01:33:52: Running steps for project untitled...
01:33:52: Starting: "C:\Qt\Tools\mingw530_32\bin\mingw32-make.exe" clean
C:/Qt/Tools/mingw530_32/bin/mingw32-make -f Makefile.Debug clean
mingw32-make[1]: Entering directory 'C:/Users/gian_/Documents/untitled'
del debug\main.o
mingw32-make[1]: Leaving directory 'C:/Users/gian_/Documents/untitled'
C:/Qt/Tools/mingw530_32/bin/mingw32-make -f Makefile.Release clean
mingw32-make[1]: Entering directory 'C:/Users/gian_/Documents/untitled'
del release\main.o
Could Not Find C:\Users\gian_\Documents\untitled\release\main.o
mingw32-make[1]: Leaving directory 'C:/Users/gian_/Documents/untitled'
01:33:52: The process "C:\Qt\Tools\mingw530_32\bin\mingw32-make.exe" exited normally.
01:33:52: Configuration unchanged, skipping qmake step.
01:33:52: Starting: "C:\Qt\Tools\mingw530_32\bin\mingw32-make.exe"
C:/Qt/Tools/mingw530_32/bin/mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory 'C:/Users/gian_/Documents/untitled'
g++ -c -fno-keep-inline-dllexport -pipe -g -std=gnu++11 -Wextra -Wall -W -fexceptions -mthreads -DUNICODE -DQT_QML_DEBUG -I. -I..\..\..\..\Qt\5.9.1\mingw53_32\mkspecs\win32-g++ -o debug\main.o main.cpp
g++ -Wl,-subsystem,console -mthreads -o debug\untitled.exe debug/main.o
mingw32-make[1]: Leaving directory 'C:/Users/gian_/Documents/untitled'
01:33:53: The process "C:\Qt\Tools\mingw530_32\bin\mingw32-make.exe" exited normally.
01:33:53: Elapsed time: 00:01.
MY COMPILER OUTPUT
00:21:00: Running steps for project untitled3...
00:21:00: Starting: "C:\Qt\5.9.1\mingw53_32\bin\qmake.exe" C:\Users\jay\Documents\untitled3\untitled3.pro -spec win32-g++ "CONFIG+=debug" "CONFIG+=qml_debug"
Info: creating stash file C:\Users\jay\Documents\build-untitled3-Desktop_Qt_5_9_1_MinGW_32bit-Debug\.qmake.stash
00:21:00: The process "C:\Qt\5.9.1\mingw53_32\bin\qmake.exe" exited normally.
00:21:00: Starting: "C:\Qt\Tools\mingw530_32\bin\mingw32-make.exe" qmake_all
mingw32-make: Nothing to be done for 'qmake_all'.
00:21:00: The process "C:\Qt\Tools\mingw530_32\bin\mingw32-make.exe" exited normally.
00:21:00: Starting: "C:\Qt\Tools\mingw530_32\bin\mingw32-make.exe"
C:/Qt/Tools/mingw530_32/bin/mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory 'C:/Users/jay/Documents/build-untitled3-Desktop_Qt_5_9_1_MinGW_32bit-Debug'
g++ -c -fno-keep-inline-dllexport -pipe -g -std=gnu++11 -Wextra -Wall -W -fexceptions -mthreads -DUNICODE -DQT_QML_DEBUG -I..\untitled3 -I. -I..\..\..\..\Qt\5.9.1\mingw53_32\mkspecs\win32-g++ -o debug\main.o ..\untitled3\main.cpp
g++ -Wl,-subsystem,console -mthreads -o debug\untitled3.exe debug/main.o
mingw32-make[1]: Leaving directory 'C:/Users/jay/Documents/build-untitled3-Desktop_Qt_5_9_1_MinGW_32bit-Debug'
00:21:01: The process "C:\Qt\Tools\mingw530_32\bin\mingw32-make.exe" exited normally.
00:21:01: Running steps for project untitled1...
00:21:01: Configuration unchanged, skipping qmake step.
00:21:01: Starting: "C:\Qt\Tools\mingw530_32\bin\mingw32-make.exe"
C:/Qt/Tools/mingw530_32/bin/mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory 'C:/Users/jay/Documents/build-untitled1-Desktop_Qt_5_9_1_MinGW_32bit-Debug'
mingw32-make[1]: Nothing to be done for 'first'.
mingw32-make[1]: Leaving directory 'C:/Users/jay/Documents/build-untitled1-Desktop_Qt_5_9_1_MinGW_32bit-Debug'
00:21:01: The process "C:\Qt\Tools\mingw530_32\bin\mingw32-make.exe" exited normally.
00:21:01: Elapsed time: 00:01.
I could not find any other issues like this, I have tried searching.
QtCreator will not build 'Hello World'
QtCreator build failed mingw
QtCreator not building with qmake.exe
QtCreator build error using MinGW
Thank you to anyone who takes the time to look this over.
EDIT: I was asked to provide our Envrioment Variables, so here you go.
His Environment Vars
My Environment Vars
SOLVED
So, after much issue we discovered that the description was he was getting messages in his build in regards to his "RELEASE" settings as well, we still have not solved the issue as to why his build chain is different, even though we have identical setups.
So to anyone who MAY have this issue, simply build in debug, build in release, then switch back to debug and run it, worked for my friend.
Related
my code:
#include<iostream>
int main()
{
int a{};
std::cout<<"enter number";
std::cin>>a;
}
the build log for this code:
C:\WINDOWS\system32\cmd.exe /C C:/MinGW/bin/mingw32-make.exe -j8 SHELL=cmd.exe -e -f Makefile
"----------Building project:[ ConstructorsAndDestructors - Debug ]----------"
mingw32-make.exe[1]: Entering directory 'C:/Users/AT/Documents/OOP_basics/Constructors&Destructors'
C:/MinGW/bin/g++.exe -c "C:/Users/AT/Documents/OOP_basics/Constructors&Destructors/main.cpp" -g -O0 -Wall -o Debug/main.cpp.o -I. -I.
C:/MinGW/bin/g++.exe -o Debug/ConstructorsAndDestructors #"ConstructorsAndDestructors.txt" -L.
mingw32-make.exe[1]: Leaving directory 'C:/Users/AT/Documents/OOP_basics/Constructors&Destructors'
====0 errors, 0 warnings====
Furthermore, when I build the same code on a different project, it works correctly, and the console stays till I input the number and waits for pressing any key to exit.
Following is the build log when I build the same code on a different project
C:\WINDOWS\system32\cmd.exe /C C:/MinGW/bin/mingw32-make.exe -j8 SHELL=cmd.exe -e -f Makefile
"----------Building project:[ AcessingClassMembers - Debug ]----------"
mingw32-make.exe[1]: Entering directory 'C:/Users/AT/Documents/OOP_basics/AcessingClassMembers'
C:/MinGW/bin/g++.exe -c "C:/Users/AT/Documents/OOP_basics/AcessingClassMembers/main.cpp" -g -O0 -Wall -o Debug/main.cpp.o -I. -I.
C:/MinGW/bin/g++.exe -o Debug/AcessingClassMembers #"AcessingClassMembers.txt" -L.
mingw32-make.exe[1]: Leaving directory 'C:/Users/AT/Documents/OOP_basics/AcessingClassMembers'
====0 errors, 0 warnings====
As there's no visible difference in the build logs, then what is causing problem.
According to this documentation page https://wiki.codelite.org/pmwiki.php/Main/ProjectSettings
Project Settings
[...]
When executing your program inside CodeLite, it actually runs in a terminal. The checkbox Pause when execution ends, which is ticked by default, means that the terminal stays open after closing the program; so any error messages or program output remains visible. If you don't need this, you can untick the box.
So, you may need to control your settings, rather than adding a spurious std::cin at the end of your program.
I want to learn to use shaders and therefore created a new C++ project on Netbeans (ver. 8.0.2).
I want to include the GLFW and the GLEW Library like stated in this tutorial: http://www.learnopengl.com/#!Getting-started/Creating-a-window
I think i included the librarys successfully. (Netbeans shows no error when using #include <GL\glew.h> or #include <GLFW\glfw3.h>, so i think it finds all the files).
My System: Windows 10 x64, using GNU gcc compiler via cygwin
Now here is the problem:
When i try to run the program, there is the following output:
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory '/cygdrive/c/Users/Erik/programming/projects/FinallyShaders'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/Cygwin-Windows/finallyshaders.exe
make[2]: Entering directory '/cygdrive/c/Users/Erik/programming/projects/FinallyShaders'
mkdir -p build/Debug/Cygwin-Windows
rm -f "build/Debug/Cygwin-Windows/main.o.d"
gcc -c -g -include /cygdrive/C/Users/Erik/programming/Libraries/glew-1.13.0-win32/glew-1.13.0/include/GL -include /cygdrive/C/Users/Erik/programming/Libraries/glfw-3.1.2.bin.WIN32/glfw-3.1.2.bin.WIN32/include/GLFW -MMD -MP -MF "build/Debug/Cygwin-Windows/main.o.d" -o build/Debug/Cygwin-Windows/main.o main.c
cc1: fatal error: /cygdrive/C/Users/Erik/programming/Libraries/glew-1.13.0-win32/glew-1.13.0/include/GL: No such file or directory
compilation terminated.
nbproject/Makefile-Debug.mk:66: recipe for target 'build/Debug/Cygwin-Windows/main.o' failed
make[2]: *** [build/Debug/Cygwin-Windows/main.o] Error 1
make[2]: Leaving directory '/cygdrive/c/Users/Erik/programming/projects/FinallyShaders'
nbproject/Makefile-Debug.mk:59: recipe for target '.build-conf' failed
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory '/cygdrive/c/Users/Erik/programming/projects/FinallyShaders'
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 722ms)
It seems to fail because the gcc compiler (or more precisely the cc1 part of it) can't find the include-directory for the library. But, as stated, the path is correct. When using cd <the path that cannot be found> everything works and cygwin finds this path.
(My program does nothing but calling printf() until now, that shouldn't be the problem)
Does anybody know what this could mean and how to solve this?
Thanks for your help
Erik Brendel
Your failing compiler commandline is:
gcc -c -g \
-include /cygdrive/C/Users/Erik/programming/Libraries/glew-1.13.0-win32/glew-1.13.0/include/GL \
-include /cygdrive/C/Users/Erik/programming/Libraries/glfw-3.1.2.bin.WIN32/glfw-3.1.2.bin.WIN32/include/GLFW \
-MMD -MP -MF "build/Debug/Cygwin-Windows/main.o.d" \
-o build/Debug/Cygwin-Windows/main.o main.c
To fix the reported error:
cc1: fatal error: /cygdrive/C/Users/Erik/programming/Libraries/glew-1.13.0-win32/glew-1.13.0/include/GL: No such file or directory
it should be:
gcc -c -g \
-I/cygdrive/C/Users/Erik/programming/Libraries/glew-1.13.0-win32/glew-1.13.0/include/GL \
-I/cygdrive/C/Users/Erik/programming/Libraries/glfw-3.1.2.bin.WIN32/glfw-3.1.2.bin.WIN32/include/GLFW \
-MMD -MP -MF "build/Debug/Cygwin-Windows/main.o.d" \
-o build/Debug/Cygwin-Windows/main.o main.c
You have confused the compiler options -include and -I. See the documentation of
these options
Here is a pretty good introductory tutorial to the use of GCC
In the Netbeans project properties, the include search-directories should be
entered in Build -> C Compiler -> Include Directories, not Include Headers.
Are you configuring the proyect linker for Netbeans?? This means telling the IDE you will be using libraries that are not added by default with just the include command, for example the math.h library(remember you had to compile with -lm via command promp, it's the same thing).
This can be done by going to run-proyect configuration-customize-Linker-Libraries(you click on the button with says ...).
Then you click on add pkgconfig library or standard(for something like math.h or pthread in unix systems), and search for the library you wish to add.
I've setup a project in CodeLite (mingw, windows 10 64bit), that uses SFML with static linking. Rebuilding or cleaning the project produces this output:
C:\WINDOWS\system32\cmd.exe /C E:/DevTools/WinBuilds/bin/mingw32-make.exe -j8 SHELL=cmd.exe -e -f Makefile
"----------Building project:[ SFML-Test - Release-Static ]----------"
mingw32-make.exe[1]: Entering directory 'E:/Workspaces/CodeLite/SFML/SFML-Test'
codelite-cc E:/DevTools/WinBuilds/bin/g++.exe -c "E:/Workspaces/CodeLite/SFML/SFML-Test/main.cpp" -O2 -std=c++11 -Wall -DNDEBUG -DSFML_STATIC -o ./Release-Static/main.cpp.o -I. -I. -IE:/Lib/cpp/SFML/include
"E:/DevTools/WinBuilds/bin/mingw32-make.exe": Interrupt/Exception caught (code = 0xc0000005, addr = 0x00007FFF8AFFEED8)
mingw32-make.exe: *** [All] Error 255
Makefile:4: recipe for target 'All' failed
====1 errors, 0 warnings====
If I build the project again it works, until I clean it again.
I've read that this is a problem of make and "(" or ")" in the path. I altered my environment PATH. The path to mingw is the first entry, but the problem still persists ...
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've installed Qt Open source 4.8.3 library for Windows on Windows 8 Pro x64, Qt Creator 2.6.0 and MingW 4.4.0 manually. From Qt Creator I've setup kits and compilers. I opened the analog clock example comes along with Qt Creator and rebuild the project. The following error are emitted by the compiler.
Running steps for project analogclock...
Starting: "C:\Qt\4.8.3\bin\qmake.exe" C:\Qt\4.8.3\examples\widgets\analogclock\analogclock.pro -r -spec win32-g++
The process "C:\Qt\4.8.3\bin\qmake.exe" exited normally.
Starting: "C:\MingW\bin\mingw32-make.exe"
C:/MingW/bin/mingw32-make -f Makefile.Release
mingw32-make[1]: Entering directory `C:/Qt/4.8.3/examples/widgets/analogclock-build-Desktop-Release'
g++ -c -O2 -Wall -Wextra -fno-exceptions -fno-rtti -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -DQT_NO_DYNAMIC_CAST -I"..\..\..\include\QtCore" -I"..\..\..\include\QtGui" -I"..\..\..\include" -I"..\..\..\include\ActiveQt" -I"release" -I"..\analogclock" -I"." -I"..\..\..\mkspecs\win32-g++" -o release\analogclock.o **..\analogclock\analogclock.cpp**
mingw32-make[1]: Leaving directory `C:/Qt/4.8.3/examples/widgets/analogclock-build-Desktop-Release'
mingw32-make[1]: *** [release/analogclock.o] Error 1
mingw32-make: *** [release] Error 2
The process "C:\MingW\bin\mingw32-make.exe" exited with code 2.
Error while building/deploying project analogclock (target: Desktop)
When executing step 'Make'
I've verified that C:/Qt/4.8.3/examples/widgets/analogclock/analogclock.cpp exists. Besides, this project comes with Qt installation and I didn't change anything.
Why is this error occurring and how can i fix it?
It seems your installation of g++ is not clean, so the compiler cannot be launched (this is also what you've said in the comments). Try reinstall, and then you can try to build a hello world program to verify whether you can run g++. Also, please verify that your PATH variable is properly configured for mingw.
Sounds like a bad mingw installation. Are there any other unix-ish things in your %PATH%, i.e. cygwin, or msys, perl, ruby, ... or other versions of mingw?