Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Weird build behavior

Weird build behavior

Scheduled Pinned Locked Moved Solved General and Desktop
11 Posts 5 Posters 638 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Atr0p0sA Offline
    Atr0p0sA Offline
    Atr0p0s
    wrote on last edited by Atr0p0s
    #1

    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:
    c84124a8-b1c9-49db-9caf-b2f754599463-image.png

    C ? 2 Replies Last reply
    0
    • Atr0p0sA Offline
      Atr0p0sA Offline
      Atr0p0s
      wrote on last edited by
      #9

      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!

      SGaistS 1 Reply Last reply
      1
      • Atr0p0sA Atr0p0s

        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:
        c84124a8-b1c9-49db-9caf-b2f754599463-image.png

        C Offline
        C Offline
        CPPUIX
        wrote on last edited by
        #2

        @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.

        Atr0p0sA 1 Reply Last reply
        2
        • Atr0p0sA Atr0p0s

          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:
          c84124a8-b1c9-49db-9caf-b2f754599463-image.png

          ? Offline
          ? Offline
          A Former User
          wrote on last edited by
          #3

          @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.

          1 Reply Last reply
          1
          • C CPPUIX

            @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.

            Atr0p0sA Offline
            Atr0p0sA Offline
            Atr0p0s
            wrote on last edited by Atr0p0s
            #4

            @Abderrahmene_Rayene @ankou29666
            Could it be because of these (highlighted) quotes?
            I see that ' and " appears only once in lines.
            87861baa-e903-4100-bd01-2e4bd295f297-image.png

            JonBJ 1 Reply Last reply
            0
            • Atr0p0sA Atr0p0s

              @Abderrahmene_Rayene @ankou29666
              Could it be because of these (highlighted) quotes?
              I see that ' and " appears only once in lines.
              87861baa-e903-4100-bd01-2e4bd295f297-image.png

              JonBJ Offline
              JonBJ Offline
              JonB
              wrote on last edited by JonB
              #5

              @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?

              Atr0p0sA 1 Reply Last reply
              1
              • JonBJ JonB

                @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?

                Atr0p0sA Offline
                Atr0p0sA Offline
                Atr0p0s
                wrote on last edited by
                #6

                @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.

                C ? 2 Replies Last reply
                0
                • Atr0p0sA Atr0p0s

                  @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.

                  C Offline
                  C Offline
                  CPPUIX
                  wrote on last edited by
                  #7

                  @Atr0p0s could you post your git history?
                  Everything you did using git, merges, commits, and their messages.

                  1 Reply Last reply
                  1
                  • Atr0p0sA Atr0p0s

                    @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.

                    ? Offline
                    ? Offline
                    A Former User
                    wrote on last edited by
                    #8

                    @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.

                    1 Reply Last reply
                    1
                    • Atr0p0sA Offline
                      Atr0p0sA Offline
                      Atr0p0s
                      wrote on last edited by
                      #9

                      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!

                      SGaistS 1 Reply Last reply
                      1
                      • Atr0p0sA Atr0p0s has marked this topic as solved on
                      • Atr0p0sA Atr0p0s

                        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!

                        SGaistS Offline
                        SGaistS Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on last edited by
                        #10

                        Hi,

                        To avoid that issue, you should use QMAKE_SUBSTITUTES so you can use a template to generate a header file containing that variable. See this blog post.

                        Interested in AI ? www.idiap.ch
                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                        Atr0p0sA 1 Reply Last reply
                        2
                        • SGaistS SGaist

                          Hi,

                          To avoid that issue, you should use QMAKE_SUBSTITUTES so you can use a template to generate a header file containing that variable. See this blog post.

                          Atr0p0sA Offline
                          Atr0p0sA Offline
                          Atr0p0s
                          wrote on last edited by
                          #11

                          @SGaist Thank you, sir!

                          1 Reply Last reply
                          0

                          • Login

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • Users
                          • Groups
                          • Search
                          • Get Qt Extensions
                          • Unsolved