Why is CMake ending prematurely in Qt Creator? - qt

I'm new to Qt Creator and wanted to import an existing CMake project into it. I loaded the CMakeLists.txt file as a project, and after running CMake, it found my files like I hoped.
But when it builds, it seems to end prematurely after one second. Here is the log:
17:11:46: Running steps for project My-GUI...
17:11:46: Starting: "C:\Program Files\JetBrains\CLion 2017.1.3\bin\cmake\bin\cmake.exe" --build . --target clean
17:11:46: Starting: "C:\Program Files\JetBrains\CLion 2017.1.3\bin\cmake\bin\cmake.exe" --build . --target spectrumSaver
"C:\Program Files\JetBrains\CLion 2017.1.3\bin\cmake\bin\cmake.exe" -HC:\Users\user\WorkingFiles\Excellims\My-GUI -BC:\Users\user\WorkingFiles\Excellims\build-My-GUI-Desktop_Qt_5_9_0_MSVC2015_64bit-Default --check-build-system CMakeFiles\Makefile.cmake 0
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\nmake.exe" -f CMakeFiles\Makefile2 /nologo -L spectrumSaver
"C:\Program Files\JetBrains\CLion 2017.1.3\bin\cmake\bin\cmake.exe" -HC:\Users\user\WorkingFiles\Excellims\My-GUI -BC:\Users\user\WorkingFiles\Excellims\build-My-GUI-Desktop_Qt_5_9_0_MSVC2015_64bit-Default --check-build-system CMakeFiles\Makefile.cmake 0
"C:\Program Files\JetBrains\CLion 2017.1.3\bin\cmake\bin\cmake.exe" -E cmake_progress_start C:\Users\user\WorkingFiles\Excellims\build-My-GUI-Desktop_Qt_5_9_0_MSVC2015_64bit-Default\CMakeFiles 7
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\nmake.exe" -f CMakeFiles\Makefile2 /nologo -L CMakeFiles\spectrumSaver.dir\all
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\nmake.exe" -f shared\CMakeFiles\shared.dir\build.make /nologo -L shared\CMakeFiles\shared.dir\depend
"C:\Program Files\JetBrains\CLion 2017.1.3\bin\cmake\bin\cmake.exe" -E cmake_depends "NMake Makefiles" C:\Users\user\WorkingFiles\Excellims\My-GUI C:\Users\user\WorkingFiles\My-GUI\src\shared C:\Users\user\WorkingFiles\My-GUI\build-My-GUI-Desktop_Qt_5_9_0_MSVC2015_64bit-Default C:\Users\user\WorkingFiles\My-GUI\build-My-GUI-Desktop_Qt_5_9_0_MSVC2015_64bit-Default\shared C:\Users\user\WorkingFiles\Excellims\build-My-GUI-Desktop_Qt_5_9_0_MSVC2015_64bit-Default\shared\CMakeFiles\shared.dir\DependInfo.cmake --color=
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\nmake.exe" -f shared\CMakeFiles\shared.dir\build.make /nologo -L shared\CMakeFiles\shared.dir\build
[ 28%] Built target shared
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\nmake.exe" -f CMakeFiles\spectrumSaver.dir\build.make /nologo -L CMakeFiles\spectrumSaver.dir\depend
17:11:47: Elapsed time: 00:01.
You can see that CMake reports the build is 28% complete, just before ending.
I can't find any information on this and all my fiddling has yet to fix it. I'm using CMake 3.7.2 (that comes with CLion), but I have also used CMake 3.8.2 (independently installed). This is on Windows 7, with Qt Creator 4.3.0 using the Microsoft Visual C++ 2015 compiler.

It's not clear what was causing it to stop building prematurely, but after I restarted Qt Creator, the problem went away. It now builds completely.

Related

Building qtwebengine of Qt 5.12.4 on msvc2017 to enable proprietary codecs

I want to build Qt 5.12.4 on Windows 10 to have qtwebengine with proprietary codec for x86 applications but I get the 64-bit cross-building or native toolchain is required error as follows by running qmake .\qtwebengine -- -webengine-proprietary-codecs command.
Before running qmake command, I do the following steps:
Run Windows command prompt as Administrator. change directory to
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build
and run the following script:
vcvarsall.bat amd64_x86
I run this command because I want to build Qt WebEngine for x86 applications.
Change directory to
D:\Qt\Qt5.12.4\5.12.4\Src
and run the below command:
configure -webengine-proprietary-codecs
After this configuration setting, I got this result:
I installed these Qt webengine compile prerequisites:
-Python 2.7.15
-Bison, Flex from here
-GPerf(32bit) from here
-ActivePerl(64bit) from here
-LLVM(64bit) from here
-Visual Studio 2017
-Windows 10 SDK
I also add them to Windows path and restart my machine.
Besides, I also install MSVC 2015 64-bit, MSVC 2017 32-bit, MSVC 2017 64-bit, Sources, Qt WebEngine, and Qt Network Authorization components.
For windows I compiled qtwebengine with proprietary codecs using a bat file.
create qt5vars.bat. Paste below lines. Put this file in D:\Qt\Qt5.12.4\5.12.4\Src folder.
#echo off
REM Set up \Microsoft Visual Studio 2015, where <arch> is \c amd64, \c x86, etc.
CALL "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Auxiliary\Build\vcvarsall.bat" amd64_x86
REM Edit this location to point to the source code of Qt
SET _ROOT=D:\Qt\Qt5.12.4\5.12.4\Src
SET PATH=%_ROOT%\qtbase\bin;%_ROOT%\gnuwin32\bin;%PATH%
SET _ROOT=
REM Keeps the command line open when this script is run.
cmd /k
Run the bat file.
Note: for qtwebengine compilation you need to enable the long path name support otherwise compilation may fail. To enable it use below link:
https://superuser.com/questions/1119883/windows-10-enable-ntfs-long-paths-policy-option-missing

Fortify build for .NET Core Projects

I'm trying to run following powerShell script for scan my solution(.NET Core 2.0) with Fortify:
$SolutionFilePath = "C:\Repositories\MyProject"
$SolutionFileName = "MyProjectToTest"
$SSCFPRFileName = "MyProjectToTest.fpr"
$BuildIdName = "MyProjectToTest"
$path = "D:\Fortify"
If(!(test-path $path))
{
New-Item -ItemType Directory -Force -Path $path
}
cd \
cd "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin"
sourceanalyzer -b $BuildIdName -clean
sourceanalyzer -b $BuildIdName msbuild "$SolutionFilePath\$SolutionFileName.sln"
sourceanalyzer -b $BuildIdName -scan -f "$path\$SSCFPRFileName"
exit 0
Every things works fine in my local machine.
But when I tried to run it in the server as a build step in TeamCity (TeamCity Enterprise 2018.2.1 (build 61078)) I got an error:
Microsoft (R) Build Engine version 16.0.461+g6ff56ef63c for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
MSBUILD : error MSB1021: Cannot create an instance of the logger. Could not load file or assembly 'Microsoft.Build.Utilities, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
Switch: C:\Program Files\HPE_Security\Fortify_SCA_and_Apps_17.20\Core\lib\FortifyMSBuildTouchless.dll
I'm using same version of Fortify in my local and the server (Fortify Static Code Analyzer 17.20.0183 (using JRE 1.8.0_144)
).
In both server and local machine I installed Build Tools for Visual Studio 2019 and .Net core SDK.
I tried with different version of MsBuild(14, 15, 16) and dotnet.exe and devenv.exe and I installed PowerShell Core. I got the same error.
I also could run the script in the same server for .NETFramework projects successfully, the only change is I used different path:
cd "C:\Windows\Microsoft.NET\Framework64\v4.0.30319"
It seems Fortify 17.20 does not support the .NETCore 2.X, When I add the 
-dotnet-core-version 2.0
I got an error (in both local and server): 
[error]: Invalid parameter 2.0 for command line argument -dotnet-core-version
but with 1.X is OK, so how is possible the same version of fortify works fine in local but not in the server?
What is the problem with .NETCore projects? any idea?
After some searching I found this one and it works fine for me:
$SolutionFilePath = "C:\Repositories\MyProject"
$SolutionFileName = "MyProjectToTest"
$SSCFPRFileName = "MyProjectToTest.fpr"
$BuildIdName = "MyProjectToTest"
$path = "D:\Fortify"
If(!(test-path $path))
{
New-Item -ItemType Directory -Force -Path $path
}
cd \
cd "$SolutionFilePath"
sourceanalyzer -b $BuildIdName -clean
sourceanalyzer -b $BuildIdName -libdirs **/* **/*
sourceanalyzer -b $BuildIdName -scan -f "$path\$SSCFPRFileName"
exit 0
No msbuild no other commands just navigate to solution folder and run it without any extra command.

Qt 5.10.0 static build error

I'm trying to build Qt 5.10.0 statically from source on Windows.
I've run Visual Studio 2017 Command Prompt and executed the following command:
>configure -static -release -platform win32-msvc
But I've got an error:
cl -c -Fo./ -Fdqmake.pdb -W2 -nologo -O1 /MP /wd4577 -IC:\qtbase-5.10\qtbase-5.10\qmake -IC:\qtbase-5.10\qtbase-5.10\qmake\library -IC:\qtbase-5.10\qtbase-5.10\qmake\generators -IC:\qtbase-5.10\qtbase-5.10\qmake\generators\unix -IC:\qtbase-5.10\qtbase-5.10\qmake\generators\win32 -IC:\qtbase-5.10\qtbase-5.10\qmake\generators\mac -IC:\qtbase-5.10\qtbase-5.10/include -IC:\qtbase-5.10\qtbase-5.10/include\QtCore -IC:\qtbase-5.10\qtbase-5.10/include\QtCore\5.10.1 -IC:\qtbase-5.10\qtbase-5.10/include\QtCore\5.10.1\QtCore -I..\src\corelib\global -IC:\qtbase-5.10\qtbase-5.10\mkspecs\win32-msvc -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS -DQT_VERSION_STR=\"5.10.1\" -DQT_VERSION_MAJOR=5 -DQT_VERSION_MINOR=10 -DQT_VERSION_PATCH=1 -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DPROEVALUATOR_FULL -DQT_NO_FOREACH -DUNICODE -c -Yc -Fpqmake_pch.pch -TP C:\qtbase-5.10\qtbase-5.10\qmake\qmake_pch.h
qmake_pch.h
..\src\corelib\global\qglobal.h(63): fatal error C1083: cannot open include file: QtCore/qconfig-bootstrapped.h: No such file or directory
NMAKE : fatal error U1077: "d:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\bin\HostX86\x86\cl.EXE" : return code "0x2"
Stop.
What can I do with this?
You should run configure from Visual Studio Developer Command Prompt.
You can also open regular command prompt and run following commands before configure
CALL "<path inside to your Visual Studio installation>\vcvarsall.bat" x86
SET PATH=<path to Qt sources>\qtbase\bin;%PATH%
SET PATH=<path to Qt sources>\gnuwin32\bin;%PATH%
Use amd64 instead of x86 for 64 bit Qt build as vcvarsall parameter.
Make sure you have perl and python in your path.

GitLab CE - How to load a .net (core) build environment on the runner?

I'm using GitLab CE as our source control system. It's on prem but updated to the latest version.
I have a Runner configured to build .net projects.
I have a dotNet Core Project that I want to build. The problem i'm having is loading the .net Build environments. I'm trying to run this to establish the environment:
`- 'cmd /K "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\Tools\VsMSBuildCmd.bat"'
This executes correct to the point that I get this output:
$ cmd /K "C:\Program Files ^(x86^)\Microsoft Visual Studio\2017\BuildTools\Common7\Tools\VsMSBuildCmd.bat"
**********************************************************************
** Visual Studio 2017 MSBuild Command Prompt
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
C:\GitLab-Runner\builds\352e1762\0\online\WebApp>$ nuget restore src/Online-WebApp.sln
MSBuild auto-detection: using msbuild version '15.5.179.9764' from 'C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\bin'.
...rest removed...
The problem is when it gets the job step in the Yml, the msbuild command is reported as not recognized.
Here's the full YAML.
Note that manually setting the PATH worked to find msbuild....
variables:
DATABASE_URL: "example=not-real" #just to show this is an option; https://docs.gitlab.com/ce/ci/variables/README.html
stages:
- build
before_script:
#- 'PATH=%PATH%;C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin'
#- 'cmd /K "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\Tools\VsDevCmd.bat"'
#- 'cmd /K "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\Tools\LaunchDevCmd.bat"'
- 'cmd /K "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\Tools\VsMSBuildCmd.bat"'
- 'nuget restore src/Online-WebApp.sln'
# What is important, is that each job is run independently from each other. "build" is a job.
build:
stage: build
script:
- 'msbuild src/Online-WebApp.sln /t:Clean,ReBuild /p:Configuration=Release;Platform="Any CPU"'
- 'dotnet pack src/Online-WebApp/Online-WebApp.csproj -c Release -v d --output nupkgs --no-build'
only:
- master

Aptana 3.6.0 jre Error in Windows os

i used Aptana 3.4.2 and its run well.
when i download 3.6.0(Current version) and install it i get this Error:
---------------------------
Aptana Studio 3
---------------------------
Java was started but returned exit code=13
C:\ProgramData\Oracle\Java\javapath\javaw.exe
-Xms128m
-Xmx512m
-Xverify:none
-Declipse.p2.unsignedPolicy=allow
-Declipse.log.size.max=10000
-Declipse.log.backup.max=5
-Djava.awt.headless=true
-XX:MaxPermSize=256m
-jar C:\Program Files (x86)\AptanaStudio\\plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar
-os win32
-ws win32
-arch x86
-showsplash
-launcher C:\Program Files (x86)\Aptana Studio\AptanaStudio3.exe
-name Aptana Studio 3
--launcher.library C:\Program Files (x86)\AptanaStudio\\plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.200.v20140116-2212\eclipse_1503.dll
-startup C:\Program Files (x86)\Aptana Studio\\plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar
--launcher.overrideVmargs
-exitdata 2f90_7c
-vm C:\ProgramData\Oracle\Java\javapath\javaw.exe
-vmargs
-Xms128m
-Xmx512m
-Xverify:none
-Declipse.p2.unsignedPolicy=allow
-Declipse.log.size.max=10000
-Declipse.log.backup.max=5
-Djava.awt.headless=true
-XX:MaxPermSize=256m
-jar C:\Program Files (x86)\Aptana Studio\\plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar
and ini file is(AptanaStudio3.ini):
-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.200.v20140116-2212
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-name
Aptana Studio 3
-vmargs
-Xms128m
-Xmx512m
-Xverify:none
-Declipse.p2.unsignedPolicy=allow
-Declipse.log.size.max=10000
-Declipse.log.backup.max=5
-Djava.awt.headless=true
my jre path is:
C:\Program Files\Java\jre1.8.0_20
i add this line
-vm C:\Program Files\Java\jre1.8.0_20\bin\javaw.exe
into AptanaStudio3.ini
but not fix!
Install the 32-bit java as well and that should clear your issue. Although its x64 compatible it does not like to find the x64 Java. Even if you link it to your correct java you get the ini error. Weird but it works.
Prefix the system PATH variable in the studio3.bat file with the JRE 32bit path and launch the program using the batch file.
set PATH=%PRGF86%\Java\jre1.8.0_25;%PRGF86%\Java\jre1.8.0_25\bin;%PATH%;
That way you won't interfere with your other 64 applications.
To pin the batch file to the taskbar, create a short cut for the file and add cmd.exe /C at the beginning of its target properties.
I was facing same issue: You should install jdk 1.8. Then look for the aptanaStudio3.ini file (C:\Users\yourName\AppData\Roaming\Appcelerator\Aptana Studio), open the file (text-editor) and insert these two lines:
-vm
C:\Program Files (x86)\Java\jdk1.8.0_181\bin\javaw.exe
before vmargs in the .ini file. (this is important if you place at the beginning or end, it will not work)
See my complete AptanaStudio3.ini file
-startup
plugins/org.eclipse.equinox.launcher_1.4.0.v20161219-1356.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.551.v20171108-1834
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vm
C:\Program Files (x86)\Java\jdk1.8.0_161\bin\javaw.exe
-vmargs
-Dosgi.requiredJavaVersion=1.8
-Xms256m
-Xmx1024m
--add-modules=ALL-SYSTEM
-Declipse.p2.unsignedPolicy=allow
-Declipse.log.size.max=10000
-Declipse.log.backup.max=5
-Dfile.encoding=UTF-8
-Djava.awt.headless=true

Resources