Qt Creator not compiling on Windows 10
-
You are right, Christian.
Here is Windows:W:\>cd WhiteDolphin\WhiteDolphinV2\WhiteDolphin\WhiteGUI W:\WhiteDolphin\WhiteDolphinV2\WhiteDolphin\WhiteGUI>dir ..\WhiteEngine\whiteapi.cpp Datenträger in Laufwerk W: ist userhomes Volumeseriennummer: E7CE-5580 Verzeichnis von W:\WhiteDolphin\WhiteDolphinV2\WhiteDolphin\WhiteEngine 17.07.2021 07:26 16.140 whiteapi.cpp 1 Datei(en), 16.140 Bytes 0 Verzeichnis(se), 11.005.326.700.544 Bytes frei W:\WhiteDolphin\WhiteDolphinV2\WhiteDolphin\WhiteGUI>
-
And from where do you call make? Since your build dir is not your source dir I would guess it's wrong.
Use absolute paths, use your code into the current dir or create a separate library with a separate pro file but don't use relative paths for sources. -
Thanks Christian - good idea, done.
I have just copied the entire tree into a new directory and put all external sources (the ones with relative paths) into the project directory. I have removed the SOURCES and HEADERS section from the .pro file and added every file manually through the "add existing file" function.
The SOUCRES section reads as follows (HEADER section is identical except for .h instead of .cpp).SOURCES += \ whiteapi.cpp \ whitedata.cpp \ whitefile.cpp \ whitejson.cpp \ whitelog.cpp \ whiterequest.cpp \ whitestatus.cpp \ whitetimer.cpp \ whitetools.cpp \ whitetranslator.cpp \ apikey.cpp \ apiwizard.cpp \ detailam.cpp \ detailar.cpp \ detailrender.cpp \ importfile.cpp \ main.cpp \ models.cpp \ notyfier.cpp \ whitebar.cpp \ whiteclient.cpp \ whiteconfig.cpp \ whitegui.cpp \ whitelogin.cpp \ whitetimerpopup.cpp \ whiteview.cpp
Error message stays the same, save for absolute paths being used now.
g++: error: WINDOWS -IC:/Users/User/Documents/WhiteGUI -I. -I../../../Win64/include -I../WhiteEngine -I../WhiteEngine -I../WhiteEngine -I../WhiteEngine -IC:/Qt/6.1.2/mingw81_64/include -IC:/Qt/6.1.2/mingw81_64/include/QtQuickControls2 -IC:/Qt/6.1.2/mingw81_64/include/QtQuick -IC:/Qt/6.1.2/mingw81_64/include/QtOpenGL -IC:/Qt/6.1.2/mingw81_64/include/QtWidgets -IC:/Qt/6.1.2/mingw81_64/include/QtGui -IC:/Qt/6.1.2/mingw81_64/include/QtQmlModels -IC:/Qt/6.1.2/mingw81_64/include/QtQml -IC:/Qt/6.1.2/mingw81_64/include/QtNetwork -IC:/Qt/6.1.2/mingw81_64/include/QtCore -Idebug -I. -IC:/VulkanSDK/1.0.51.0/Include -IC:/Qt/6.1.2/mingw81_64/mkspecs/win32-g++ -o debug\whiteapi.o C:\Users\User\Documents\WhiteGUI\whiteapi.cpp: No such file or directory g++: fatal error: no input files compilation terminated.
The message clearly seems misleading as the file claimed to be missing is actually existing:
C:\Users\User\Documents\WhiteGUI>dir whiteapi.cpp Datenträger in Laufwerk C: ist Windows Volumeseriennummer: B2A1-AA19 Verzeichnis von C:\Users\User\Documents\WhiteGUI 17.07.2021 07:26 16.140 whiteapi.cpp 1 Datei(en), 16.140 Bytes 0 Verzeichnis(se), 160.223.092.736 Bytes frei C:\Users\User\Documents\WhiteGUI>
-
@AxelVienna
I could be wrong, but I am not 100% convinced that error message is saying quite what you think it is, from the way it is written. (It actually looks to me as though the whole long command line is being passed/treated as naming one file...?)Your error message starts:
g++: error: WINDOWS -IC:/Users/User/Documents/WhiteGUI ...
Where is that plain word
WINDOWS
at the beginning coming from?P.S.
If you open a Command Prompt and try, say,gcc "WINDOWS -IC:/Users/User/Documents/WhiteGUI -o debug\whiteapi.o C:\Users\User\Documents\WhiteGUI\whiteapi.cpp"
Note the quoting I have put in. How does the error message read for this? (Interested to see whether it echoes this whole line back with
: No such file or directory
at the end?) -
WINDOWS results from a define in the build target.
DEFINES+=WINDOWS
-
@AxelVienna
I don't know how that causesgcc WINDOWS ...
, which does not look right to me....In any case, I put in a P.S. for you to try, to see whether my suspicion is correct or mistaken?
-
@AxelVienna said in Qt Creator not compiling on Windows 10:
DEFINES+=WINDOWS
This is not in your pro file you posted above
@JonB : good catch
-
You are right, it is not in the .pro file. It is set in the project settings for the compile kit under “additional commands”. I use that excessively to trigger conditional code for different targets.
As your suggested command line input delivers the same error, I will give it a try and eliminate it. -
@AxelVienna said in Qt Creator not compiling on Windows 10:
WINDOWS results from a define in the build target.
DEFINES+=WINDOWSI can not find this in the project file from your first post.
But in this project, you have included 3 timesAPIKeyGUI.ui
inFORMS
and added 4 times../WhiteEngine
inINCLUDEPATH
.Perhaps you should first cleanup the pro file and remove redundant informations?
-
@AxelVienna said in Qt Creator not compiling on Windows 10:
It is set in the project settings for the compile kit under “additional commands”.
Why? Why do you think when you enter something there QtCreator magically knows that it should be a define and be prefixed with '-DWINDOWS'?
No need for such a define at all - WIN32 is defined by default with every windows compiler. -
Well, as I said in the very beginning: Most likely, I have made a stupid configuration mistake.
Thanks to all for pointing me to the right spot.