Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Solved Error in toolchain.prf when building new project

    General and Desktop
    5
    10
    2443
    Loading More Posts
    • 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
      glarson last edited by

      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?

      jsulm 1 Reply Last reply Reply Quote 1
      • jsulm
        jsulm Lifetime Qt Champion @glarson last edited by

        @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 Reply Quote 1
        • G
          glarson last edited by glarson

          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 Reply Quote 0
          • SGaist
            SGaist Lifetime Qt Champion last edited by

            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 Reply Quote 2
            • G
              glarson @SGaist last edited by

              @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 Reply Quote 0
              • SGaist
                SGaist Lifetime Qt Champion last edited by

                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 Reply Quote 1
                • G
                  glarson @SGaist last edited by

                  @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 Reply Quote 2
                  • SGaist
                    SGaist Lifetime Qt Champion last edited by

                    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 Reply Quote 0
                    • A
                      Andrew Banson @SGaist last edited by

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

                      Phrogz 1 Reply Last reply Reply Quote 0
                      • Phrogz
                        Phrogz @Andrew Banson last edited by Phrogz

                        @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 Reply Quote 0
                        • First post
                          Last post