Solved Error in toolchain.prf when building new project
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:
I'm getting an error when building it, and here's an image of the error:
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?
@glarson Can you go to "Compile Output" (tab 5 at the bottom) and copy paste the whole build log here?
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.
Hi and welcome to devnet,
Can you show the content of
@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).
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 ?
@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:
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.
Glad you found out and thanks for sharing !
Happy coding :)
I'm currently experiencing the exact same issue. Do you think the issue is somehow related the code page set?
Phrogz 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
Autorunregistry key with the value
chcp 65001in 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.
Note: Instead of removing the
chcp 65001Unicode 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