Errors occur when building yaml-cpp in Windows
-
Hello, I have some issues when building yaml-cpp with Qt Creator.
When using MinGW 64-bit, it will come up with this error:
C:\Program Files\CMake\share\cmake-3.16\Modules\CMakeMinGWFindMake.cmake:12: error: sh.exe was found in your PATH, here: C:/devkitPro/msys/bin/sh.exe For MinGW make to work correctly sh.exe must NOT be in your path. Run cmake from a shell that does not have sh.exe in your PATH. If you want to use a UNIX shell, then use MSYS Makefiles. CMakeLists.txt:3 (project)
But when I try to build using MSVC 2017 64bit, it comes up with this error:
C:\Temp\AME\yaml-cpp\test\gtest-1.8.0\googletest\include\gtest\internal\gtest-port.h:996: error: C2220: warning treated as error - no 'object' file generated
And the error that I mentioned earlier that said "sh.exe must not be in your PATH", it's actually where devkitPro is installed, and it's actually a requirement for some projects to be built.
The question is, will devkitPro compilers still work if they're removed from the System Environment Variables PATH? Because that's the only place where devkitPro Environment Variable is found:
C:\Python27\; C:\Python27\Scripts; c:\devkitPro\msys\bin; C:\Program Files (x86)\Intel\iCLS Client\; C:\Program Files\Intel\iCLS Client\; C:\WINDOWS\system32; C:\WINDOWS; C:\WINDOWS\System32\Wbem; C:\WINDOWS\System32\WindowsPowerShell\v1.0\; C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL; C:\Program Files\Intel\Intel(R) Management Engine Components\DAL; C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT; C:\Program Files\Intel\Intel(R) Management Engine Components\IPT; C:\Program Files (x86)\Skype\Phone\; C:\WINDOWS\system32; C:\WINDOWS; C:\WINDOWS\System32\Wbem; C:\WINDOWS\System32\WindowsPowerShell\v1.0\; C:\Program Files (x86)\Common Files\Seagate\SnapAPI\; C:\Program Files (x86)\Common Files\Acronis\VirtualFile\; C:\Program Files (x86)\Common Files\Acronis\VirtualFile64\; C:\Program Files (x86)\Common Files\Acronis\SnapAPI\; C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\; C:\Program Files\PuTTY\; C:\MinGW\bin; C:\WINDOWS\System32\OpenSSH\; C:\Program Files\dotnet\; C:\Program Files\Microsoft SQL Server\130\Tools\Binn\; C:\Strawberry\c\bin; C:\Strawberry\perl\site\bin; C:\Strawberry\perl\bin; C:\Program Files\CMake\bin; C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common; C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR
-
Anything Qt related here?
-
@Christian-Ehrlicher Yep, I'm trying to build yaml-cpp in Qt Creator, and those errors appear.
-
Hi,
One thing you can do is go to the Build part of the Project panel and modify PATH there.
-
@Platinum-Lucario said in Errors occur when building yaml-cpp in Windows:
Yep, I'm trying to build yaml-cpp in Qt Creator, and those errors appear.
Then don't use qtcreator - I would guess it doesn't work there too.
-
@SGaist said in Errors occur when building yaml-cpp in Windows:
Hi,
One thing you can do is go to the Build part of the Project panel and modify PATH there.
The Build part of the project panel, it's this part, right?
I selected "Clear system environment" box in that section, and it came up with this error instead:
C:\Qt\Tools\CMake_64\share\cmake-3.16\Modules\CMakeTestCXXCompiler.cmake:53: error: The C++ compiler "C:/Qt/Tools/mingw730_64/bin/g++.exe" is not able to compile a simple test program. It fails with the following output: Change Dir: C:/Temp/AME/yaml-cpp/bin/CMakeFiles/CMakeTmp Run Build Command(s):C:/Qt/Tools/mingw730_64/bin/mingw32-make.exe cmTC_13973/fast && C:/Qt/Tools/mingw730_64/bin/mingw32-make.exe -f CMakeFiles\cmTC_13973.dir\build.make CMakeFiles/cmTC_13973.dir/build mingw32-make.exe[1]: Entering directory 'C:/Temp/AME/yaml-cpp/bin/CMakeFiles/CMakeTmp' Building CXX object CMakeFiles/cmTC_13973.dir/testCXXCompiler.cxx.obj C:\Qt\Tools\mingw730_64\bin\g++.exe -o CMakeFiles\cmTC_13973.dir\testCXXCompiler.cxx.obj -c C:\Temp\AME\yaml-cpp\bin\CMakeFiles\CMakeTmp\testCXXCompiler.cxx Cannot create temporary file in C:\WINDOWS\: Permission denied mingw32-make.exe[1]: *** [CMakeFiles\cmTC_13973.dir\build.make:65: CMakeFiles/cmTC_13973.dir/testCXXCompiler.cxx.obj] Error 3 mingw32-make.exe[1]: Leaving directory 'C:/Temp/AME/yaml-cpp/bin/CMakeFiles/CMakeTmp' mingw32-make.exe: *** [Makefile:120: cmTC_13973/fast] Error 2
When I tried to change the CMake Tool from the drop down box in the MinGW 64-bit kit, sure it worked for a bit, then when I tried to build it, it came up with lots of different errors.
And when I closed and reopened the project after modifying the MinGW 64-bit kit, it came up with the same error all over again, which is:
C:\Program Files\CMake\share\cmake-3.16\Modules\CMakeMinGWFindMake.cmake:12: error: sh.exe was found in your PATH, here: C:/devkitPro/msys/bin/sh.exe For MinGW make to work correctly sh.exe must NOT be in your path. Run cmake from a shell that does not have sh.exe in your PATH. If you want to use a UNIX shell, then use MSYS Makefiles. CMakeLists.txt:3 (project)
And also, there's this message that appears:
-
I'm not sure why the error is occurring when trying to build yaml-cpp. I'd like to fix the issue, but I'm not sure how to.
-
Okay! I've fixed the problem!
All I needed to do was remove
C:/devkitPro/msys/bin/
from the System PATH in Environmental Variables and then disabled YAML_CPP_BUILD_TESTS in the Qt Projects Build Settings for yaml-cpp, and it worked!For some reason, GTest (Google Test Framework) doesn't build in MinGW, that's why it has that error.