[SOLVED:] Parameters to gcc, like -Wno-comment
-
If the rebuild doesn't do, just delete the shadow build. From time to time it's the only option on Windows...
Also depending on what you modify (i.e a warning flag) make won't rebuild everything since it's does not modify any actual file. Should there be something that touches every file of the project or mark something as force-rebuild when a flag is modified ? Maybe. That could make the object of a feature request for QtCreator
-
None of these seem to be picked up from the .pro file:
@QMAKE_CXXFLAGS += -Wno-comment
QMAKE_CXXFLAGS_WARN_OFF += -Wno-comment@so they must be wrong. If I quote them into qmake, they don't appear in the build either. I have some Qt users with me, and have we tried.. Help!
-
I wise guy here guessed that since I have plain C project, this this might help:
@QMAKE_CFLAGS += -Wno-comment@
It did, since we now got it in the gcc build string:
@gcc -c -pipe -fno-keep-inline-dllexport -Wno-comment -g -Wall -Wextra -DUNICODE -D_AUTROKEEPER_QT_PLAINC_ -D_COMPILE_WARNINGS_A_ -I..\autrokeeper_Qt_plainC -I"..\autrokeeper" -I"..\avr8" -I"..\scheduler" -I"." -I"C:\Qt\Qt5.1.0\5.1.0\mingw48_32\mkspecs\win32-g++" -o debug\S_ChanSched.o ..\scheduler\S_ChanSched.c@
But I still got the "multi-line comment" error. Is this because it came before -Wall? If so, how do I move -Wall in front of -Wno-comment? I have experimentet and can't see a command that removes the last -Wall.
Do I have to specify some rule in some file to get rid of the -Wall, and then introduce one myself in from of the -Wno-comment?
-
You might have to edit the win32-g++ mkspec for that
-
Again thanks for not giving me up!
I digged based on that cue, and the answer seems to go like this:Comment out (with a #)
@QMAKE_CFLAGS_WARN_ON = -Wall -Wextra@
from the file (Qt installed at standard place on windows):
@C:\Qt\Qt5.1.0\5.1.0\mingw48_32\mkspecs\win32-g++\qmake.conf@
and add this in the Qt Creator .pro file:
@QMAKE_CFLAGS += -Wall -Wextra
QMAKE_CFLAGS += -Wno-comment@This will make -Wno-comment overtake -Wall for that explicit warning. Build now looks like this, with -Wno-comment parsed after -Wall etc. by gcc:
@gcc -c -pipe -fno-keep-inline-dllexport -Wall -Wextra -Wno-comment -g -DUNICODE -D_AUTROKEEPER_QT_PLAINC_ -D_COMPILE_WARNINGS_A_ -I..\autrokeeper_Qt_plainC -I"..\autrokeeper" -I"..\avr8" -I"..\scheduler" -I"." -I"C:\Qt\Qt5.1.0\5.1.0\mingw48_32\mkspecs\win32-g++" -o debug\S_ChanSched.o ..\scheduler\S_ChanSched.c@
This seems to work. Please advice if there are any errors in my reasoning above. I will add [SOLVED] after some time if it's all ok.
-
If you want to use these option for several or all your projects, you can modify the mkspec or create your own and use that one
-
Ok, where do I in case put my own? Will it override the original, or will the original have to be removed?
-
if you create your own, you just need copy/paste the original folder and rename it (plus make the modifications you want). Then you'll need to use the new name in the Kits configuration.
-
I moved the \win32-g++ directory with the modified qmake.conf to a local directory, inside my project. Then I went through this in Qt Creator (but I am not certain if this is right and what you meant!):
@| Projects
| Manage Kits
| Build & Run
| Kits
| Manual
| Add .. name etc plus most importantly:
| Qt mskspec: path to new \win32-g++ directory@I now have two Kits, the default and my new.
But do observe, I also had to move the directory "\common" to the same level as the "\win32-g++" directory, as I got a complaint. Does this have any side effect (i.e. is there a tool that would update any file(s) in any of these two directories)?
-
I would just have added the new mkspec in the same directory but with a different name i.e "mywin32-g++"