Weird build behavior
-
During building sometimes I get the error:
:-1: error: [Makefile.Debug:4433: debug/parse_nmea.o] Error 2
For example, yesterday I got the error only once - I just re-downloaded the project and the error disappeared.
But today I merged branches and always get the error.
I tried to re-download the project several times and it worked once with Qt 5.15.2 MinGW 64-bit kit (but not Qt 6.4.3 MinGW 64-bit kit). After that, I re-downloaded the project again and I could not build the project (neither qt5 nor qt6).Do you have any ideas why this is happening and how I can avoid this error?
In the output I can find these messages:
-
The reason was in the .pro file in the line:
DEFINES += "'VERSION_STRING=\"$$system(git tag) $$system(git log -n 1)\"'"
As @JonB wrote, it may be a very long string in certain cases and I think that's why it led to errors when I changed branches.
Thank you men, @Abderrahmene_Rayene @ankou29666 @JonB, for your help!
-
@Atr0p0s As @jsulm said here, you need to focus on the error above the one you're mentioning, because that's the one specifying what went wrong.
/usr/bin/sh: -c: line 1: unexpected EOF while looking for matching `"'
Whatever file this error is mentioning, is the problem, specifically at
line 1
, you need to figure out what file is this and its source.Also mention more details, an error build is not enough to fix this problem for people reading your post.
-
@Atr0p0s My first thought is that you opened a single tick quote that you didn't close. At least it's what the error message suggests, it found End-Of-File while it was searching for a tick, obviously a closing tick matching the opening one.
But what's surprising me is that it would happen at build time, it's the kind of error I'd rather expect at compile time. really weird indeed.
-
@Abderrahmene_Rayene @ankou29666
Could it be because of these (highlighted) quotes?
I see that ' and " appears only once in lines.
-
@Atr0p0s
Yes that will be syntactically incorrect for whatever kind of/usr/bin/sh
you are using under Windows. Neither the"
nor the'
are closed. The comment string is quite long, maybe the code is barfing at the length and failing to terminate properly? How is that-D'VERSION_STRING="
stuff specified to get passed to the compiler? -
@Atr0p0s said in Weird build behavior:
@JonB said in Weird build behavior:
How is that -D'VERSION_STRING=" stuff specified to get passed to the compiler?
I am trying to figure it out =)
I am sure that this is the root of the problem.Have these arguments been passed manually to the builder ? If yes, this is where you have to search for the problem.
-
The reason was in the .pro file in the line:
DEFINES += "'VERSION_STRING=\"$$system(git tag) $$system(git log -n 1)\"'"
As @JonB wrote, it may be a very long string in certain cases and I think that's why it led to errors when I changed branches.
Thank you men, @Abderrahmene_Rayene @ankou29666 @JonB, for your help!
-