GammaRay build Error on windows10 with Microsoft Visual Studio
-
Hi,I want to build GammaRay from source on windows10 with Microsoft Visual Studio;
when execute nmake command I get the error below:[ 33%] Building CXX object tests/CMakeFiles/benchsuite.dir/benchsuite_autogen/mocs_compilation.cpp.obj mocs_compilation.cpp [ 33%] Linking CXX executable ..\bin\benchsuite.exe [ 33%] Built target benchsuite Scanning dependencies of target quickmaterialtest_autogen [ 33%] Automatic MOC, UIC and RCC for target quickmaterialtest [ 33%] Built target quickmaterialtest_autogen Scanning dependencies of target quickmaterialtest [ 33%] Building CXX object tests/CMakeFiles/quickmaterialtest.dir/quickmaterialtest.cpp.obj quickmaterialtest.cpp C:\Qt\Qt5.12.3\5.12.3\msvc2017\include\QtQml\5.12.3\QtQml\private/qv4value_p.h(673): error C2131: 表达式的计算结果不是常数 C:\Qt\Qt5.12.3\5.12.3\msvc2017\include\QtQml\5.12.3\QtQml\private/qv4value_p.h(488): note: 因为返回临时项或对其的引用的地址导致了故障 C:\Qt\Qt5.12.3\5.12.3\msvc2017\include\QtQml\5.12.3\QtQml\private/qv4value_p.h(673): note: 计算“QV4::Value::undefinedValue()”时 C:\Qt\Qt5.12.3\5.12.3\msvc2017\include\QtQml\5.12.3\QtQml\private/qv4stackframe_p.h(189): note: 计算“QV4::Encode::undefined()”时 C:\Qt\Qt5.12.3\5.12.3\msvc2017\include\QtQml\5.12.3\QtQml\private/qv4stackframe_p.h(189): error C2131: 表达式的计算结果不是常数 C:\Qt\Qt5.12.3\5.12.3\msvc2017\include\QtQml\5.12.3\QtQml\private/qv4value_p.h(488): note: 因为返回临时项或对其的引用的地址导致了故障 NMAKE : fatal error U1077: “C:\PROGRA~2\MICROS~1.0\VC\bin\cl.exe”: 返回代码“0x2” Stop. NMAKE : fatal error U1077: “"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\nmake.exe"”: 返回代码“0x2” Stop. NMAKE : fatal error U1077: “"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\nmake.exe"”: 返回代码“0x2” Stop.
what is the error? How to resolve it?
Thank you! -
@sz_y It would help if you would translate Chinese into English.
This is the information about the error: https://docs.microsoft.com/de-de/cpp/error-messages/compiler-errors-1/compiler-error-c2131?view=vs-2019 -
@sz_y said in GammaRay build Error on windows10 with Microsoft Visual Studio:
error:[ 33%] Building CXX object tests/CMakeFiles/benchsuite.dir/benchsuite_autogen/mocs_compilation.cpp.obj
mocs_compilation.cpp
[ 33%] Linking CXX executable ..\bin\benchsuite.exe
[ 33%] Built target benchsuite
Scanning dependencies of target quickmaterialtest_autogen
[ 33%] Automatic MOC, UIC and RCC for target quickmaterialtest
[ 33%] Built target quickmaterialtest_autogen
Scanning dependencies of target quickmaterialtest
[ 33%] Building CXX object tests/CMakeFiles/quickmaterialtest.dir/quickmaterialtest.cpp.obj
quickmaterialtest.cpp
C:\Qt\Qt5.12.3\5.12.3\msvc2017\include\QtQml\5.12.3\QtQml\private/qv4value_p.h(673): error C2131: Expression does not evaluate to a constant
C:\Qt\Qt5.12.3\5.12.3\msvc2017\include\QtQml\5.12.3\QtQml\private/qv4value_p.h(488): note: Failure due to return temporary item or the address of reference to it
C:\Qt\Qt5.12.3\5.12.3\msvc2017\include\QtQml\5.12.3\QtQml\private/qv4value_p.h(673): note: compute “QV4::Value::undefinedValue()”
C:\Qt\Qt5.12.3\5.12.3\msvc2017\include\QtQml\5.12.3\QtQml\private/qv4stackframe_p.h(189): note: compute “QV4::Encode::undefined()”
C:\Qt\Qt5.12.3\5.12.3\msvc2017\include\QtQml\5.12.3\QtQml\private/qv4stackframe_p.h(189): error C2131: Expression does not evaluate to a constant
C:\Qt\Qt5.12.3\5.12.3\msvc2017\include\QtQml\5.12.3\QtQml\private/qv4value_p.h(488): note: Failure due to return temporary item or the address of reference to it
NMAKE : fatal error U1077: “C:\PROGRA~2\MICROS~1.0\VC\bin\cl.exe”: return code“0x2”
Stop.
NMAKE : fatal error U1077: “"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\nmake.exe"”: return code“0x2”
Stop.
NMAKE : fatal error U1077: “"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\nmake.exe"”: return code“0x2”
Stop. -
@sz_y You should try with latest Qt 5.12.x release.
Check whether you can disable tests as it looks like the error comes from there.
Also, you use Qt for VS2017 but VS2015. Shouldn't be an issue as compiler are now compatible. -
@jsulm said in GammaRay build Error on windows10 with Microsoft Visual Studio:
I don't want build x86_x64,
my build environment is as follow:
windows10
computer system type :64 bit os,based on x64 processor
VS2015
qt-opensource-windows-x86-5.12.3
CMAKE:cmake-3.10.1-win64-x64What should I do?
-
GammaRay has a million dependencies which are hard to set up manually, the easiest way to build it is using craft.
You can check out the appveyor.yml file in the folder to see what commands the developers are running to build the program in their Windows CI