Issues compiling GLFM with Emscripten and CMake on Windows - c++

I am trying to compile GLFM using emscripten and cmake. I followed the instructions on the GitHub page to do so, and the cmake command to generate all of the project files works without a hitch (other than some deprecation warnings), but when I enter the line cmake --build . I get errors.
Here is the entire output:
E:\emproj\glfm\build\emscripten>cmake --build .
Microsoft (R) Build Engine version 15.6.85.37198 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 4/27/2018 3:21:04 PM.
Project "E:\emproj\glfm\build\emscripten\ALL_BUILD.vcxproj" on node 1 (default targets).
Project "E:\emproj\glfm\build\emscripten\ALL_BUILD.vcxproj" (1) is building "E:\emproj\glfm\build\emscripten\ZERO_CHECK
.vcxproj" (2) on node 1 (default targets).
InitializeBuildStatus:
Creating "Win32\Debug\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
CustomBuild:
All outputs are up-to-date.
FinalizeBuildStatus:
Deleting file "Win32\Debug\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild".
Touching "Win32\Debug\ZERO_CHECK\ZERO_CHECK.tlog\ZERO_CHECK.lastbuildstate".
Done Building Project "E:\emproj\glfm\build\emscripten\ZERO_CHECK.vcxproj" (default targets).
Project "E:\emproj\glfm\build\emscripten\ALL_BUILD.vcxproj" (1) is building "E:\emproj\glfm\build\emscripten\glfm.vcxpr
oj" (3) on node 1 (default targets).
InitializeBuildStatus:
Touching "glfm.dir\Debug\glfm.tlog\unsuccessfulbuild".
CustomBuild:
All outputs are up-to-date.
ClCompile:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\bin\HostX86\x86\CL.exe /c /IE
:\emproj\glfm\include /IE:\emproj\glfm\src /nologo /W1 /WX- /diagnostics:classic /O2 /Oy- /D "CMAKE_INTDIR=\"Debug\""
/D _MBCS /Gm- /MD /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"glfm.dir\Debug\\" /Fd"glfm.dir\Debug\glfm.
pdb" /Gd /TC /analyze- /FC /errorReport:queue -g -Weverything -Wwrite-strings -Wno-padded -Wno-covered-switch-defaul
t E:\emproj\glfm\src\glfm_platform_emscripten.c
cl : Command line error D8021: invalid numeric argument '/Weverything' [E:\emproj\glfm\build\emscripten\glfm.vcxproj]
Done Building Project "E:\emproj\glfm\build\emscripten\glfm.vcxproj" (default targets) -- FAILED.
Done Building Project "E:\emproj\glfm\build\emscripten\ALL_BUILD.vcxproj" (default targets) -- FAILED.
Build FAILED.
"E:\emproj\glfm\build\emscripten\ALL_BUILD.vcxproj" (default target) (1) ->
"E:\emproj\glfm\build\emscripten\glfm.vcxproj" (default target) (3) ->
(ClCompile target) ->
cl : Command line error D8021: invalid numeric argument '/Weverything' [E:\emproj\glfm\build\emscripten\glfm.vcxproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.68
Its complaint is with the argument /Weverything. I looked in the project's CMakeLists.txt file and it looks like this command is only supposed to be used if the active compiler is clang. Could this be the issue? It is using visual studio as a host, should it be doing that?
It says that emscripten 1.35.0 is required and that's the exact version I'm using.
I also followed the instructions to get it running in Android Studio and it worked without a hitch.
Thanks in advance for help!

The solution to this problem is as follows:
Don't use windows.
I used Ubuntu and everything went excellently aside from installing a modern version cmake. After searching for a while the method for doing that which worked for me can be found here: https://peshmerge.io/how-to-install-cmake-3-11-0-on-ubuntu-16-04/

Related

CMake Error: Could NOT find Boost (missing: system filesystem thread log locale regex chrono atomic date_time) (found version "1.75.0")

I am attempting to build and run a c++ program from GitHub, although i keep running into problems presumably with Cmake and the boost libraries. It is the first time i have tried building a program, so there is probably something obvious missing.
The program in question is from the following GitHub repository: https://github.com/antimix/PrusaSlicer. I am opening the folder i Visual Studio Code as an administrator (to remove some other error) with the Cmake and Cmake tools extensions installed. I have installed 1.75.0 Boost from this site: https://boost.teeks99.com/. From the Visual Code terminal I get the following error(s):
[cmake] CMake Error at C:/Program Files/CMake/share/cmake-3.20/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
[cmake] Could NOT find Boost (missing: system filesystem thread log locale regex
[cmake] chrono atomic date_time) (found version "1.75.0")
[cmake] Call Stack (most recent call first):
[cmake] C:/Program Files/CMake/share/cmake-3.20/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
[cmake] C:/Program Files/CMake/share/cmake-3.20/Modules/FindBoost.cmake:2344 (find_package_handle_standard_args)
[cmake] CMakeLists.txt:266 (find_package)
And here is the full log:
[variant] Loaded new set of variants
[kit] Successfully loaded 8 kits from C:\Users\*user*\AppData\Local\CMakeTools\cmake-tools-kits.json
[main] Configuring folder: PrusaSlicer-dribbling_2.2.0
[proc] Executing command: "C:\Program Files\CMake\bin\cmake.EXE" "-Hc:/Program Files/Prusa3D/PrusaSlicer-dribbling_2.2.0" "-Bc:/Program Files/Prusa3D/PrusaSlicer-dribbling_2.2.0/build" -G "Visual Studio 16 2019" -T host=x64 -A win32
[proc] Executing command: "C:\Program Files\CMake\bin\cmake.EXE" --no-warn-unused-cli -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE "-Hc:/Program Files/Prusa3D/PrusaSlicer-dribbling_2.2.0" "-Bc:/Program Files/Prusa3D/PrusaSlicer-dribbling_2.2.0/build" -G "Visual Studio 16 2019" -T host=x64 -A win32
[cmake] Not searching for unused variables given on the command line.
[cmake] -- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.18363.
[cmake] -- SLIC3R_ASAN: OFF
[cmake] -- SLIC3R_BUILD_SANDBOXES: OFF
[cmake] -- SLIC3R_BUILD_TESTS: ON
[cmake] -- SLIC3R_FHS: OFF
[cmake] -- SLIC3R_GTK: 2
[cmake] -- SLIC3R_GUI: ON
[cmake] -- SLIC3R_MSVC_COMPILE_PARALLEL: ON
[cmake] -- SLIC3R_MSVC_PDB: ON
[cmake] -- SLIC3R_PCH: ON
[cmake] -- SLIC3R_PERL_XS: OFF
[cmake] Building without Win10 Netfabb STL fixing service support
[cmake] -- SLIC3R_PROFILE: OFF
[cmake] -- SLIC3R_STATIC: ON
[cmake] -- SLIC3R_WX_STABLE: ON
[cmake] -- SLIC3R_STATIC: ON
[cmake] -- CMAKE_PREFIX_PATH: (default)
[cmake] CMake Error at C:/Program Files/CMake/share/cmake-3.20/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
[cmake] Could NOT find Boost (missing: system filesystem thread log locale regex
[cmake] chrono atomic date_time) (found version "1.75.0")
[cmake] Call Stack (most recent call first):
[cmake] C:/Program Files/CMake/share/cmake-3.20/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
[cmake] C:/Program Files/CMake/share/cmake-3.20/Modules/FindBoost.cmake:2344 (find_package_handle_standard_args)
[cmake] CMakeLists.txt:266 (find_package)
[cmake]
[cmake]
[cmake] -- Configuring incomplete, errors occurred!
[cmake] See also "C:/Program Files/Prusa3D/PrusaSlicer-dribbling_2.2.0/build/CMakeFiles/CMakeOutput.log".
[cmake] See also "C:/Program Files/Prusa3D/PrusaSlicer-dribbling_2.2.0/build/CMakeFiles/CMakeError.log".
Also, here is the two logs that the terminal talk about if that is of interest:
CMakeOutput.log
The system is: Windows - 10.0.18363 - AMD64
Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded.
Compiler:
Build flags:
Id flags:
The output was:
0
Microsoft (R) Build Engine version 16.8.3+39993bd9d for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 21-02-2021 22:55:20.
Project "C:\Program Files\Prusa3D\PrusaSlicer-dribbling_2.2.0\build\CMakeFiles\3.20.0-rc1\CompilerIdC\CompilerIdC.vcxproj" on node 1 (default targets).
PrepareForBuild:
Creating directory "Debug\".
Creating directory "Debug\CompilerIdC.tlog\".
InitializeBuildStatus:
Creating "Debug\CompilerIdC.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
ClCompile:
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\bin\HostX64\x86\CL.exe /c /nologo /W0 /WX- /diagnostics:column /Od /Oy- /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"Debug\\" /Fd"Debug\vc142.pdb" /Gd /TC /analyze- /FC /errorReport:queue CMakeCCompilerId.c
CMakeCCompilerId.c
Link:
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\bin\HostX64\x86\link.exe /ERRORREPORT:QUEUE /OUT:".\CompilerIdC.exe" /INCREMENTAL:NO /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /PDB:".\CompilerIdC.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:".\CompilerIdC.lib" /MACHINE:X86 /SAFESEH Debug\CMakeCCompilerId.obj
CompilerIdC.vcxproj -> C:\Program Files\Prusa3D\PrusaSlicer-dribbling_2.2.0\build\CMakeFiles\3.20.0-rc1\CompilerIdC\CompilerIdC.exe
PostBuildEvent:
for %%i in (cl.exe) do #echo CMAKE_C_COMPILER=%%~$PATH:i
:VCEnd
CMAKE_C_COMPILER=C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\bin\Hostx64\x86\cl.exe
FinalizeBuildStatus:
Deleting file "Debug\CompilerIdC.tlog\unsuccessfulbuild".
Touching "Debug\CompilerIdC.tlog\CompilerIdC.lastbuildstate".
Done Building Project "C:\Program Files\Prusa3D\PrusaSlicer-dribbling_2.2.0\build\CMakeFiles\3.20.0-rc1\CompilerIdC\CompilerIdC.vcxproj" (default targets).
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:01.39
Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "CompilerIdC.exe"
Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "CompilerIdC.vcxproj"
The C compiler identification is MSVC, found in "C:/Program Files/Prusa3D/PrusaSlicer-dribbling_2.2.0/build/CMakeFiles/3.20.0-rc1/CompilerIdC/CompilerIdC.exe"
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded.
Compiler:
Build flags:
Id flags:
The output was:
0
Microsoft (R) Build Engine version 16.8.3+39993bd9d for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 21-02-2021 22:55:21.
Project "C:\Program Files\Prusa3D\PrusaSlicer-dribbling_2.2.0\build\CMakeFiles\3.20.0-rc1\CompilerIdCXX\CompilerIdCXX.vcxproj" on node 1 (default targets).
PrepareForBuild:
Creating directory "Debug\".
Creating directory "Debug\CompilerIdCXX.tlog\".
InitializeBuildStatus:
Creating "Debug\CompilerIdCXX.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
ClCompile:
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\bin\HostX64\x86\CL.exe /c /nologo /W0 /WX- /diagnostics:column /Od /Oy- /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"Debug\\" /Fd"Debug\vc142.pdb" /Gd /TP /analyze- /FC /errorReport:queue CMakeCXXCompilerId.cpp
CMakeCXXCompilerId.cpp
Link:
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\bin\HostX64\x86\link.exe /ERRORREPORT:QUEUE /OUT:".\CompilerIdCXX.exe" /INCREMENTAL:NO /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /PDB:".\CompilerIdCXX.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:".\CompilerIdCXX.lib" /MACHINE:X86 /SAFESEH Debug\CMakeCXXCompilerId.obj
CompilerIdCXX.vcxproj -> C:\Program Files\Prusa3D\PrusaSlicer-dribbling_2.2.0\build\CMakeFiles\3.20.0-rc1\CompilerIdCXX\CompilerIdCXX.exe
PostBuildEvent:
for %%i in (cl.exe) do #echo CMAKE_CXX_COMPILER=%%~$PATH:i
:VCEnd
CMAKE_CXX_COMPILER=C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\bin\Hostx64\x86\cl.exe
FinalizeBuildStatus:
Deleting file "Debug\CompilerIdCXX.tlog\unsuccessfulbuild".
Touching "Debug\CompilerIdCXX.tlog\CompilerIdCXX.lastbuildstate".
Done Building Project "C:\Program Files\Prusa3D\PrusaSlicer-dribbling_2.2.0\build\CMakeFiles\3.20.0-rc1\CompilerIdCXX\CompilerIdCXX.vcxproj" (default targets).
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:01.11
Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "CompilerIdCXX.exe"
Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "CompilerIdCXX.vcxproj"
The CXX compiler identification is MSVC, found in "C:/Program Files/Prusa3D/PrusaSlicer-dribbling_2.2.0/build/CMakeFiles/3.20.0-rc1/CompilerIdCXX/CompilerIdCXX.exe"
Detecting C compiler ABI info compiled with the following output:
Change Dir: C:/Program Files/Prusa3D/PrusaSlicer-dribbling_2.2.0/build/CMakeFiles/CMakeTmp
Run Build Command(s):C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/MSBuild/Current/Bin/MSBuild.exe cmTC_e9c90.vcxproj /p:Configuration=Debug /p:Platform=win32 /p:VisualStudioVersion=16.0 /v:m && Microsoft (R) Build Engine version 16.8.3+39993bd9d for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29336 for x86
Copyright (C) Microsoft Corporation. All rights reserved.
CMakeCCompilerABI.c
cl /c /Zi /W3 /WX- /diagnostics:column /Od /Ob0 /Oy- /D WIN32 /D _WINDOWS /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"cmTC_e9c90.dir\Debug\\" /Fd"cmTC_e9c90.dir\Debug\vc142.pdb" /Gd /TC /analyze- /errorReport:queue "C:\Program Files\CMake\share\cmake-3.20\Modules\CMakeCCompilerABI.c"
cmTC_e9c90.vcxproj -> C:\Program Files\Prusa3D\PrusaSlicer-dribbling_2.2.0\build\CMakeFiles\CMakeTmp\Debug\cmTC_e9c90.exe
Detecting CXX compiler ABI info compiled with the following output:
Change Dir: C:/Program Files/Prusa3D/PrusaSlicer-dribbling_2.2.0/build/CMakeFiles/CMakeTmp
Run Build Command(s):C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/MSBuild/Current/Bin/MSBuild.exe cmTC_65605.vcxproj /p:Configuration=Debug /p:Platform=win32 /p:VisualStudioVersion=16.0 /v:m && Microsoft (R) Build Engine version 16.8.3+39993bd9d for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29336 for x86
Copyright (C) Microsoft Corporation. All rights reserved.
CMakeCXXCompilerABI.cpp
cl /c /Zi /W3 /WX- /diagnostics:column /Od /Ob0 /Oy- /D WIN32 /D _WINDOWS /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR /Fo"cmTC_65605.dir\Debug\\" /Fd"cmTC_65605.dir\Debug\vc142.pdb" /Gd /TP /analyze- /errorReport:queue "C:\Program Files\CMake\share\cmake-3.20\Modules\CMakeCXXCompilerABI.cpp"
cmTC_65605.vcxproj -> C:\Program Files\Prusa3D\PrusaSlicer-dribbling_2.2.0\build\CMakeFiles\CMakeTmp\Debug\cmTC_65605.exe
CMakeError.log
Determining if the include file pthread.h exists failed with the following output:
Change Dir: C:/Program Files/Prusa3D/PrusaSlicer-dribbling_2.2.0/build/CMakeFiles/CMakeTmp
Run Build Command(s):C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/MSBuild/Current/Bin/MSBuild.exe cmTC_3680a.vcxproj /p:Configuration=Debug /p:Platform=win32 /p:VisualStudioVersion=16.0 /v:m && Microsoft (R) Build Engine version 16.8.3+39993bd9d for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29336 for x86
Copyright (C) Microsoft Corporation. All rights reserved.
CheckIncludeFile.c
cl /c /Zi /W3 /WX- /diagnostics:column /Od /Ob0 /Oy- /D WIN32 /D _WINDOWS /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"cmTC_3680a.dir\Debug\\" /Fd"cmTC_3680a.dir\Debug\vc142.pdb" /Gd /TC /analyze- /errorReport:queue "C:\Program Files\Prusa3D\PrusaSlicer-dribbling_2.2.0\build\CMakeFiles\CMakeTmp\CheckIncludeFile.c"
C:\Program Files\Prusa3D\PrusaSlicer-dribbling_2.2.0\build\CMakeFiles\CMakeTmp\CheckIncludeFile.c(1,10): fatal error C1083: Cannot open include file: 'pthread.h': No such file or directory [C:\Program Files\Prusa3D\PrusaSlicer-dribbling_2.2.0\build\CMakeFiles\CMakeTmp\cmTC_3680a.vcxproj]
I have looked around at some different threads to find a solution but without luck. Most of them revolve around setting the system environment variables for Boost, but it seems that Cmake gives a message that it ignores this variable. I have also found a thread that suggests adding a line in the CMakeLists.txt to set the boost path before loading the libraries (as far as I understand), but none of these things unfortunately helped.
Hope some of you have a solution for this headscratcher...

"Please try enabling Per-user Redirection" with CMake and VS19

I try to build SRT with CMake on Windows 10 using VS2019 as generator.
Thru the Configure step, I have:
The C compiler identification is MSVC 19.23.28106.4 The CXX compiler
identification is MSVC 19.23.28106.4 Check for working C compiler:
C:/Program Files (x86)/Microsoft Visual
Studio/2019/Community/VC/Tools/MSVC/14.23.28105/bin/Hostx64/x86/cl.exe
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual
Studio/2019/Community/VC/Tools/MSVC/14.23.28105/bin/Hostx64/x86/cl.exe
-- broken CMake Error at C:/Program Files/CMake/share/cmake-3.15/Modules/CMakeTestCCompiler.cmake:60
(message): The C compiler
"C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.23.28105/bin/Hostx64/x86/cl.exe"
is not able to compile a simple test program. It fails with the
following output:
Change Dir: C:/Users/MLUser/Desktop/SRT/srt-1.4.0/build/CMakeFiles/CMakeTmp
Run Build Command(s):C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/MSBuild/Current/Bin/MSBuild.exe
cmTC_3ea98.vcxproj /p:Configuration=Debug /p:Platform=Win32
/p:VisualStudioVersion=16.0 /v:m && Microsoft (R) Build Engine version
16.3.1+1def00d3d for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
Microsoft (R) C/C++ Optimizing Compiler Version 19.23.28106.4 for x86
testCCompiler.c
Copyright (C) Microsoft Corporation. All rights reserved.
cl /c /I./MIDL /Zi /W3 /WX- /diagnostics:column /MP /Od /Ob0 /Oy- /D WIN32 /D _WINDOWS /D "CMAKE_INTDIR=\"Debug\"" /D _LOCAL_NODE
/D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope
/Zc:inline /Fo"cmTC_3ea98.dir\Debug\"
/Fd"cmTC_3ea98.dir\Debug\vc142.pdb" /Gd /TC /analyze-
/errorReport:queue
"C:\Users\MLUser\Desktop\SRT\srt-1.4.0\build\CMakeFiles\CMakeTmp\testCCompiler.c"
cmTC_3ea98.vcxproj -> C:\Users\MLUser\Desktop\SRT\srt-1.4.0\build\CMakeFiles\CMakeTmp\Debug\cmTC_3ea98.exe
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(1992,5):
warning MSB3073: The command
""C:\Users\MLUser\Desktop\SRT\srt-1.4.0\build\CMakeFiles\CMakeTmp\Debug\cmTC_3ea98.exe"
/RegServer" exited with code 1.
[C:\Users\MLUser\Desktop\SRT\srt-1.4.0\build\CMakeFiles\CMakeTmp\cmTC_3ea98.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(1998,5):
error MSB8011: Failed to register output. Please try enabling Per-user
Redirection or register the component from a command prompt with
elevated permissions.
[C:\Users\MLUser\Desktop\SRT\srt-1.4.0\build\CMakeFiles\CMakeTmp\cmTC_3ea98.vcxproj]
CMake will not be able to correctly generate this project. Call
Stack (most recent call first): CMakeLists.txt:15 (project)
UPD
I tried to launch Cmake GUI both with admin and no admin rights.
OK, I see that I had custom properties in: C:\Users\[User]\AppData\Local\Microsoft\MSBuild\v4.0.
It *.props files where it was configured to register output.
I removed them, and passed "output redirection" issue.

Odd compilation issue on Windows

When I declare a Mat from opencv, the program still compiles without issues, but then does not produce any output when run. There are no warnings or errors during compilation. However, this builds and runs correctly on Linux.
Is this an issue with the compiler, or am I overlooking something extremely obvious?
Note: In the build you can see that I am using the CLion IDE. I only use it for code insights and do all compilation and cmake tasks with the command line.
Includes
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include <iostream>
#include <stdio.h>
using namespace cv;
Working run
int main( int argc, char** argv ){
std::cout << "TEST\n";
// This line is commented out!
// Mat object;
if (argc < 2) {
std::cout << "There was an issue!\n";
return 0;
}
/* Commented out code */
return 0;
}
C:\Path\To\Project\build> cmake --build . --config Release
Wow! Your code is amazing and compiled without any issues!
C:\Path\To\Project\build> Release\test.exe
TEST
There was an issue!
Problem run
int main( int argc, char** argv ){
std::cout << "TEST\n";
// All I did was remove the comment on this line!
Mat object;
if (argc < 2) {
std::cout << "There was an issue!\n";
return 0;
}
/* Commented out code */
return 0;
}
C:\Path\To\Project\build> cmake --build . --config Release
Wow! Your code is amazing and compiled without any issues!
C:\Path\To\Project\build> Release\test.exe
C:\Path\To\Project\build> exited without output
Build
C:\Users\home\CLionProjects\untitled\build>cmake --build . --config Release
Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 1/14/2019 9:54:14 PM.
Project "C:\Users\home\CLionProjects\untitled\build\ALL_BUILD.vcxproj" on node 1 (default targets).
Project "C:\Users\home\CLionProjects\untitled\build\ALL_BUILD.vcxproj" (1) is building "C:\Users\home\CLionProjects\untitled\build\ZERO_CHECK.vcxproj" (2) on node 1 (default targets).
InitializeBuildStatus:
Creating "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
CustomBuild:
All outputs are up-to-date.
FinalizeBuildStatus:
Deleting file "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild".
Touching "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\ZERO_CHECK.lastbuildstate".
Done Building Project "C:\Users\home\CLionProjects\untitled\build\ZERO_CHECK.vcxproj" (default targets).
Project "C:\Users\home\CLionProjects\untitled\build\ALL_BUILD.vcxproj" (1) is building "C:\Users\home\CLionProjects\untitled\build\Test.vcxproj" (3) on node 1 (default targets).
InitializeBuildStatus:
Creating "Test.dir\Release\Test.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
CustomBuild:
All outputs are up-to-date.
ClCompile:
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\CL.exe /c /I"C:\Users\home\Documents\opencv-4.0.1\opencv-4.0.1\build\install\include" /nologo /W3 /WX- /diagnostics:classic /O2 /Ob2 /D WIN32 /D _WINDOWS /
D NDEBUG /D "CMAKE_INTDIR=\"Release\"" /D _MBCS /Gm- /EHsc /MD /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR /Fo"Test.dir\Release\\" /Fd"Test.dir\Release\vc141.pdb" /Gd /TP /errorReport:queue C:\Users\home\CLionProjects\untitled\main.cpp
main.cpp
Link:
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\link.exe /ERRORREPORT:QUEUE /OUT:"C:\Users\home\CLionProjects\untitled\build\Release\Test.exe" /INCREMENTAL:NO /NOLOGO "C:\Users\home\Documents\opencv-4.
0.1\opencv-4.0.1\build\install\x64\vc15\lib\opencv_dnn401.lib" "C:\Users\home\Documents\opencv-4.0.1\opencv-4.0.1\build\install\x64\vc15\lib\opencv_gapi401.lib" "C:\Users\home\Documents\opencv-4.0.1\opencv-4.0.1\build\install\x64\vc15\lib\opencv_ml401.lib" "
C:\Users\home\Documents\opencv-4.0.1\opencv-4.0.1\build\install\x64\vc15\lib\opencv_objdetect401.lib" "C:\Users\home\Documents\opencv-4.0.1\opencv-4.0.1\build\install\x64\vc15\lib\opencv_photo401.lib" "C:\Users\home\Documents\opencv-4.0.1\opencv-4.0.1\buil
d\install\x64\vc15\lib\opencv_stitching401.lib" "C:\Users\home\Documents\opencv-4.0.1\opencv-4.0.1\build\install\x64\vc15\lib\opencv_video401.lib" "C:\Users\home\Documents\opencv-4.0.1\opencv-4.0.1\build\install\x64\vc15\lib\opencv_calib3d401.lib" "C:\Users\
home\Documents\opencv-4.0.1\opencv-4.0.1\build\install\x64\vc15\lib\opencv_features2d401.lib" "C:\Users\home\Documents\opencv-4.0.1\opencv-4.0.1\build\install\x64\vc15\lib\opencv_flann401.lib" "C:\Users\home\Documents\opencv-4.0.1\opencv-4.0.1\build\instal
l\x64\vc15\lib\opencv_highgui401.lib" "C:\Users\home\Documents\opencv-4.0.1\opencv-4.0.1\build\install\x64\vc15\lib\opencv_videoio401.lib" "C:\Users\home\Documents\opencv-4.0.1\opencv-4.0.1\build\install\x64\vc15\lib\opencv_imgcodecs401.lib" "C:\Users\home
\Documents\opencv-4.0.1\opencv-4.0.1\build\install\x64\vc15\lib\opencv_imgproc401.lib" "C:\Users\home\Documents\opencv-4.0.1\opencv-4.0.1\build\install\x64\vc15\lib\opencv_core401.lib" kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut
32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /PDB:"C:/Users/home/CLionProjects/untitled/build/Release/Test.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"C:/Users/home
/CLionProjects/untitled/build/Release/Test.lib" /MACHINE:X64 /machine:x64 Test.dir\Release\main.obj
Test.vcxproj -> C:\Users\home\CLionProjects\untitled\build\Release\Test.exe
FinalizeBuildStatus:
Deleting file "Test.dir\Release\Test.tlog\unsuccessfulbuild".
Touching "Test.dir\Release\Test.tlog\Test.lastbuildstate".
Done Building Project "C:\Users\home\CLionProjects\untitled\build\Test.vcxproj" (default targets).
InitializeBuildStatus:
Creating "x64\Release\ALL_BUILD\ALL_BUILD.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
CustomBuild:
All outputs are up-to-date.
FinalizeBuildStatus:
Deleting file "x64\Release\ALL_BUILD\ALL_BUILD.tlog\unsuccessfulbuild".
Touching "x64\Release\ALL_BUILD\ALL_BUILD.tlog\ALL_BUILD.lastbuildstate".
Done Building Project "C:\Users\home\CLionProjects\untitled\build\ALL_BUILD.vcxproj" (default targets).
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:01.64
Is there an issue with the library I am using when building on Windows? Is my compiler silently failing? Did I make a simple mistake?

Build C++ program on Windows with CL (VS Build Tool Compiler)

I try to build program from command line with CL.
Run next command:
CL -I"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\include" C:\dev\projects\console-interaction-tester\main.cpp
And I caught error:
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\include\crtdefs.h(10): fatal error C1083: ...... corecrt.h: No such file or directory
I tried all flags from VS ouptup, like /nologo /TP /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MDd /Zi /Ob0 /Od /RTC1 /showIncludes but it doesn't work.
I need sample of command, what can ignore UniversalCRT, or instruction how fix path. I wanted to add includes dir with corecrt.h but classic location C:\Program Files (x86)\Microsoft SDKs\Windows Kits\10\includes doesn't exists!
Install Windows SDK.
Run the VS2017 installer again, and select it (or plainly select the full C++ dev package).

The C compiler "cl" is not able to compile a simple test program

I am having a trouble building ITK library (InsightToolkit-4.1.0) with cmake-gui (cmake-2.8.8-win32-x86) under Windows 7 using Visual Studio 2010, as mentioned here:
https://itk.org/Wiki/ITK/Configuring_and_Building/VisualStudio . I have done everything step by step but I don't understand what is the problem, I specified the visual studio 10 generator with default native compilers and got these errors.
Check for working C compiler using: Visual Studio 10
Check for working C compiler using: Visual Studio 10 -- broken
**CMake Error at C:/ITK/CMake/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):
The C compiler "cl" is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/ITK/Build/CMakeFiles/CMakeTmp
Run Build Command:C:\PROGRA~2\MICROS~2.0\Common7\IDE\devenv.com
CMAKE_TRY_COMPILE.sln /build Debug /project cmTryCompileExec1875248370
Microsoft (R) Visual Studio Version 10.0.30319.1.
Copyright (C) Microsoft Corp. All rights reserved.
1>------ Build started: Project: cmTryCompileExec1875248370, Configuration:
Debug Win32 ------
1> Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01
for 80x86
1> Copyright (C) Microsoft Corporation. All rights reserved.
1>
1> cl /c /Zi /W3 /WX- /Od /Ob0 /Oy- /D WIN32 /D _WINDOWS /D _DEBUG /D
"CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise
/Zc:wchar_t /Zc:forScope /Fo"cmTryCompileExec1875248370.dir\Debug\\"
/Fd"C:/ITK/Build/CMakeFiles/CMakeTmp/Debug/cmTryCompileExec1875248370.pdb"
/Gd /TC /analyze- /errorReport:prompt
C:\ITK\Build\CMakeFiles\CMakeTmp\testCCompiler.c /Zm1000
1>
1> testCCompiler.c
1>LINK : fatal error LNK1123: failure during conversion to COFF: file
invalid or corrupt
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped
==========
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:7 (project)**
Configuring incomplete, errors occurred!