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. Error in toolchain.prf when building new project

Error in toolchain.prf when building new project

Scheduled Pinned Locked Moved Solved General and Desktop
10 Posts 5 Posters 3.1k 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.
  • G Offline
    G Offline
    glarson
    wrote on last edited by
    #1

    I'm a new user, trying to build a new, empty project.
    Using Qt Creator 4.6.0.
    The project is a Qt Widgets Application for desktop.
    Here's an image of the kit I'm using for the build:
    0_1523939775974_Screenshot - 16-Apr-18 , 22_23_24.png
    I'm getting an error when building it, and here's an image of the error:
    0_1523939854600_Screenshot - 16-Apr-18 , 22_26_29.png
    If I use MinGW 32bit kit, it seems to work. But with MSVC2017 64bit, I'm getting the error. I have no idea what it is doing at the point of error, as I am completely new to using Qt. Any ideas on how I can get it to build without error?

    jsulmJ 1 Reply Last reply
    1
    • G glarson

      I'm a new user, trying to build a new, empty project.
      Using Qt Creator 4.6.0.
      The project is a Qt Widgets Application for desktop.
      Here's an image of the kit I'm using for the build:
      0_1523939775974_Screenshot - 16-Apr-18 , 22_23_24.png
      I'm getting an error when building it, and here's an image of the error:
      0_1523939854600_Screenshot - 16-Apr-18 , 22_26_29.png
      If I use MinGW 32bit kit, it seems to work. But with MSVC2017 64bit, I'm getting the error. I have no idea what it is doing at the point of error, as I am completely new to using Qt. Any ideas on how I can get it to build without error?

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @glarson Can you go to "Compile Output" (tab 5 at the bottom) and copy paste the whole build log here?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • G Offline
        G Offline
        glarson
        wrote on last edited by glarson
        #3

        Thanks, here is my Compile Output:

        08:21:50: Running steps for project MyTestApp...
        08:21:50: Starting: "G:\Qt\5.10.1\msvc2017_64\bin\qmake.exe" G:\documents\programming\QtTraining\MyTestApp\MyTestApp.pro -spec win32-msvc "CONFIG+=debug" "CONFIG+=qml_debug"
        G:/Qt/5.10.1/msvc2017_64/mkspecs/features/toolchain.prf:208: Extra characters after test expression.
        Project ERROR: Compiler produced empty value for Active.
        08:21:50: The process "G:\Qt\5.10.1\msvc2017_64\bin\qmake.exe" exited with code 3.
        Error while building/deploying project MyTestApp (kit: Desktop Qt 5.10.1 MSVC2017 64bit)
        When executing step "qmake"
        08:21:50: Elapsed time: 00:00.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi and welcome to devnet,

          Can you show the content of toolchain.prf:208 ?

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

          G 1 Reply Last reply
          2
          • SGaistS SGaist

            Hi and welcome to devnet,

            Can you show the content of toolchain.prf:208 ?

            G Offline
            G Offline
            glarson
            wrote on last edited by
            #5

            @SGaist It won't let me upload a whole file yet, but if you look at my 2nd image above, it shows precisely where the error occurred. That is in toolchain.prf. It is calling eval($$v).

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Sorry, I didn't had the image when I answered.

              Looks pretty strange. Do you have Visual Studio installed in the standard location ?

              Can you modify toolchain.prf and add message("Test: $$v) before line 208 too see what might be giving that error ?

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

              G 1 Reply Last reply
              1
              • SGaistS SGaist

                Sorry, I didn't had the image when I answered.

                Looks pretty strange. Do you have Visual Studio installed in the standard location ?

                Can you modify toolchain.prf and add message("Test: $$v) before line 208 too see what might be giving that error ?

                G Offline
                G Offline
                glarson
                wrote on last edited by
                #7

                @SGaist I did as you said, and the message it printed was "Active code page: 65001".

                Very strange - then I recalled that some time ago I added something to my registry to set the code page of my command prompt windows to 65001:

                I had followed the instructions in this YouTube video, which had me put an autorun instruction into my registry:

                https://www.youtube.com/watch?v=y6HA_sebDZ4

                So I have just removed that item from the registry, and now the project builds and runs!

                So thank you and jsulm for your help on this. Cheers! ☕
                It was such an obscure thing.

                1 Reply Last reply
                2
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  Glad you found out and thanks for sharing !

                  Happy coding :)

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

                  A 1 Reply Last reply
                  0
                  • SGaistS SGaist

                    Glad you found out and thanks for sharing !

                    Happy coding :)

                    A Offline
                    A Offline
                    Andrew Banson
                    wrote on last edited by
                    #9

                    I'm currently experiencing the exact same issue. Do you think the issue is somehow related the code page set?

                    PhrogzP 1 Reply Last reply
                    0
                    • A Andrew Banson

                      I'm currently experiencing the exact same issue. Do you think the issue is somehow related the code page set?

                      PhrogzP Offline
                      PhrogzP Offline
                      Phrogz
                      wrote on last edited by Phrogz
                      #10

                      @Andrew-Banson Absolutely! I was having this same problem: I even reinstalled both Visual Studio 2017 Community Edition and all of Qt, but brand new projects were unable to build, giving this output:

                      Running Windows Runtime device detection.
                      No winrtrunner.exe found.
                      C:/Qt/5.11.1/msvc2017_64/mkspecs/features/toolchain.prf(208): Extra characters after test expression.
                      Project ERROR: Compiler produced empty value for Active.
                      C:/Qt/5.11.1/msvc2017_64/mkspecs/features/toolchain.prf(208): Extra characters after test expression.
                      Error while parsing file C:\Users\gkistner\Documents\FooBar\FooBar.pro. Giving up.
                      

                      I had recently added an Autorun registry key with the value chcp 65001 in an attempt to fix cmd.exe's broken Unicode. As soon as I removed this registry key, I was able to build and run projects in Qt Creator.

                      @glarson Great find, thank you!
                      @SGaist Thanks for the tips that led glarson to find this. Based on the error messages, I never would have found the problem without this post.


                      Note: Instead of removing the chcp 65001 Unicode code page hack, you can modify it to emit no output text by instead using @chcp 65001>nul. This fixes Qt Creator's fragile parsing, while retaining a slightly better cmd.exe unicode experience. :p

                      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