I have a C++ project which is built with Visual Studio 2019. I started to get strange build errors in Azure Pipeline in December. Before then, the build test had passed all the time. The build is still fine on my Windows machines. It has issues only in Azure Pipeline. I get this error
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.28.29333\include\memory(619,23): error C3861: '__iso_volatile_load32': identifier not found [D:\a\1\s\build\ode\raisimODE.vcxproj]
The error message seems like it is looking for ARM instructions. Here is a snippet of my build script
cd $(Build.Repository.LocalPath)
mkdir build
cd build
cmake -Q .. -G "Visual Studio 16 2019" -A x64 -DRAISIM_TEST=ON -DCMAKE_PREFIX_PATH=$(Pipeline.Workspace)\dep\raisim_env
cmake --build . --config Release
ctest -VV -C Release
cd $(Build.Repository.LocalPath)
Related
I'm trying to compile the library OpenGV and I get the error MSVC C1060 "compiler out of heap space".
I tried to go change to x64 architecture by adding
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
<PlatformTarget>x64</PlatformTarget>
to the .vxcproj file, without success. I notice however that in the resource manager, MSBuild 32 bit is still being used. Could this be the problem, and if so, how can I change the build tool (i.e. the MSbuild version), through, say, GitBash?
If you're compiling the project through the Visual Studio IDE, the Visual Studio IDE silently uses a 32-bit compiler. To change this behavior, use the command:
msbuild {solution-name}.sln /property:Configuration=Release"
To find the path to the msbuild command on your system, use the command below:
where msbuild
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe
If the where msbuild command does not return a path like C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe, but your system has msbuild installed, go to the system variables and add the MSBuild.exe path to the system path in the file structure where Microsoft Visual Studio is installed. Remove other msbuild path variable from system variables (like C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe). Otherwise, this change may not work.
In another graphics library (solution, issue) it is reported how to solve a similar problem and its solution is reported as solved as above.
When installing OpenGV under Window it is stated in the documentation that the msbuild configuration should be changed as follows:
msbuild opengv.sln /p:Configuration=Release
In addition, if the cmake build tool will be used in the project, the following declaration should be made using the -G option to compile for x64 target machine:
cmake -G "Visual Studio 16 2019" -A x64 ../
# cmake -G "Visual Studio 16 2019" -A Win32 ../
# cmake -G "Visual Studio 16 2019" -A ARM ../
# cmake -G "Visual Studio 16 2019" -A ARM64 ../
Error during CMake configuration in visual studio 2019 (Version 16.4.3)
I have created a simple CMake project from the template provided in visual studio 2019. It connects to remote Linux server and errors out while generating "Unix Makefile" with the following error.
cd "/home/ppatori1/.vs/CMakeProject6/a2fef020-7ae8-4d61-bea2-3b0e6b20371f/out/build/Linux-Debug";/home/omega/apps/redhat-x86_64/cmake/bin/cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE="Debug" -DCMAKE_INSTALL_PREFIX=$HOME/.vs/CMakeProject6/a2fef020-7ae8-4d61-bea2-3b0e6b20371f/out/install/Linux-Debug "/home/ppatori1/.vs/CMakeProject6/a2fef020-7ae8-4d61-bea2-3b0e6b20371f/src" 2>&1; returned with exit code: 1
I checked the remote Linux server and found that it creates a file with name "1" and when I concatenate it; the content inside the file "1" is as following
CMake Error: The source directory "/home/xyz/.vs/CMakeProject6/a2fef020-7ae8-4d61-bea2-3b0e6b20371f/out/build/Linux-Debug/2" does not exist.
Specify --help for usage, or press the help button on the CMake GUI.
When I copy-paste and try to run the same command i.e.
cd "/home/ppatori1/.vs/CMakeProject6/a2fef020-7ae8-4d61-bea2-3b0e6b20371f/out/build/Linux-Debug";/home/omega/apps/redhat-x86_64/cmake/bin/cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE="Debug" -DCMAKE_INSTALL_PREFIX=$HOME/.vs/CMakeProject6/a2fef020-7ae8-4d61-bea2-3b0e6b20371f/out/install/Linux-Debug "/home/ppatori1/.vs/CMakeProject6/a2fef020-7ae8-4d61-bea2-3b0e6b20371f/src" 2>&1;
directly on the remote Linux server it works fine and generated the required cache and makefile.
It seems while running the command from visual studio 2019, 2>&1 is not interpreted as it should be, i.e., redirection of stderr to stdout instead it does weird thing by trying to redirect file "2" which does not exist to "1" or something similar.
There is no way that I can prevent Visual Studio to append 2>&1 in the CMake command to generate Makefile. Visual Studio 2019 CMake configuration does not provide any control over how I need to generate the CMake, although I can extend it (Add to it) but not fully control it. Any help on this will be appreciated. Its a show stopper for me.
I am trying to setup an environment for cucumber cpp in windows 10 and with visual studio. While trying to build the whole solution, I am facing build issues with GTest component
My current environment is as follow
OS: Windows 10
Visual Studio Community Edition 2017
CMake Version:3.14.3
Ruby Version: 2.5.5p157 (2019-03-15 revision 67260) [x64-mingw32]
Boost Library Version: 1.69.0
I followed the steps mentioned in Readme.md
Building Cucumber-Cpp with tests and samples:
# Download test suite
git submodule init
git submodule update
# Create build directory
cmake -E make_directory build
# Generate Makefiles
cmake -E chdir build cmake -DCUKE_ENABLE_EXAMPLES=on -DCMAKE_INSTALL_PREFIX=${prefix} ..
# Build cucumber-cpp and tests
cmake --build build
I am facing build issue with GTest component. Below is the error message
========================================================
Performing build step for 'gtest'
CMake Error at C:/Cucumber/cucumber-cpp/build/gmock/src/gtest-stamp/gtest-build-Debug.cmake:49 (message):
Command failed: 1
'C:/Program Files/CMake/bin/cmake.exe' '--build' '.' '--config' 'Debug'
See also
C:/Cucumber/cucumber-cpp/build/gmock/src/gtest-stamp/gtest-build-*.log
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(209,
5): error MSB6006: "cmd.exe" exited with code 1. [C:\Cucumber\cucumber-cpp\build\gtest.vcxproj]
========================================================
I want to generate Visual Studio files by this instructions, and when I use the commands:
mkdir build
cd build
cmake -G "Visual Studio 14 2015 Win64" ..
it says :
CMake Error at CMakeLists.txt:44 <project>:
Failed to run MSBuild command:
c:/Program files <x86>/MSBuild/14.0/bin/MSBuild.exe
to get the value of VCTargetspath:
Microsoft <R> Build Engine version 14.0.25420.1
Copyright <c? Microsoft Corporation. All rights reserved
MSBUILD : error MSB1009: Project file does not exist.
Switch: VCITargetspath.vcxproj
Exit code: 1
Configuring incomplete, errors occurred!
See also c:/Windows/System32/cpp-ethereum/build/CMakefiles/CMakeOutput.log
and also when I use the alt command:
cmake --build . --config RelWithDebInfo
it says:
MSBUILD : error MSB1009: Project file does not exist.
Switch: ALL_BUILD.vcxproj
I have to note that I have git, CMake and Visual Studio 2015 Professional fully installed.
I am trying to build cling for Windows using Visual Studio. After all the steps were completed as shown below, I don't seem to have the cling.exe in the directory /cling/build/Debug/bin for some reason. There's a clang.exe, clang++.exe and a bunch of random llvm ones but it seems that only cling.exe is missing. Does anyone know if I am missing some steps or what went wrong?
// Install CMake 3.6.0 and Visual Studio Express 2015 for Windows desktop
git clone root.cern.ch/git/llvm.git src
cd src
git checkout cling-patches
cd tools
git clone root.cern.ch/git/cling.git
git clone root.cern.ch/git/clang.git
cd clang
git checkout cling-patches
cd ../..
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=[Install Path] ..\src -G "Visual Studio 14"
//Go inside build directory and open LLVM.sln, run "Build Solution" on "Debug" and "Win32"
I guess it doesn't work for Windows currently but it will be ready in a couple of week.
https://root.cern.ch/phpBB3/viewtopic.php?f=21&t=22006&sid=b9bc976106f30bdd02d48427a88aa04e