Невозможно собрать yaml- cpp в Windows, используя Qt Creator - PullRequest
1 голос
/ 20 февраля 2020

Я пытаюсь собрать yaml- cpp в Windows 10, используя Qt Creator с 64-битным комплектом MinGW. Я использую репозиторий yaml- cpp -master, если кому-то интересно.

Когда я пытаюсь собрать его в Qt Creator, я получаю эту ошибку:

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)

I также пытался сделать то же самое в Qt Creator, используя Windows Sandbox (для имитации установки fre sh Windows), и происходят следующие ошибки:

C:\Users\WDAGUtilityAccount\Documents\yaml-cpp-master\test\gtest-1.8.0\googletest\src\gtest-death-test.cc:637: error: 'AutoHandle' does not name a type; did you mean 'LocalHandle'?
   AutoHandle write_handle_;
   ^~~~~~~~~~
   LocalHandle
C:\Users\WDAGUtilityAccount\Documents\yaml-cpp-master\test\gtest-1.8.0\googletest\include\gtest\internal\gtest-port.h:1782: error: 'AutoHandle' does not name a type; did you mean 'mutable'?
   AutoHandle thread_;
   ^~~~~~~~~~
   mutable
C:\Users\WDAGUtilityAccount\Documents\yaml-cpp-master\test\gtest-1.8.0\googletest\src\gtest-death-test.cc:656: error: 'child_handle_' was not declared in this scope
   const HANDLE wait_handles[2] = { child_handle_.Get(), event_handle_.Get() };
                                    ^~~~~~~~~~~~~
C:\Users\WDAGUtilityAccount\Documents\yaml-cpp-master\test\gtest-1.8.0\googletest\src\gtest-death-test.cc:670: error: 'write_handle_' was not declared in this scope
   write_handle_.Reset();
   ^~~~~~~~~~~~~
C:\Users\WDAGUtilityAccount\Documents\yaml-cpp-master\test\gtest-1.8.0\googletest\src\gtest-death-test.cc:720: error: 'write_handle_' was not declared in this scope
   write_handle_.Reset(write_handle);
   ^~~~~~~~~~~~~
C:\Users\WDAGUtilityAccount\Documents\yaml-cpp-master\test\gtest-1.8.0\googletest\src\gtest-death-test.cc:777: error: 'child_handle_' was not declared in this scope
   child_handle_.Reset(process_info.hProcess);
   ^~~~~~~~~~~~~

В «Песочнице» * 1028 таких ошибок так много, что я не могу перечислить их все, их около 33 (некоторые из них являются дубликатами тех же ошибок). Это не происходит, когда я собираю yaml- cpp в Ubuntu или любом дистрибутиве GNU / Linux и собираю практически без проблем.

Так почему эти ошибки возникают только в Windows, а не в Ubuntu?

Когда я пытался собрать yaml- cpp в Qt Creator с использованием 64-битного набора MSV C 2017, произошла эта ошибка:

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

Я действительно запутался что происходит и почему он работает только в дистрибутивах GNU / Linux, и почему он не встраивается в Windows? Есть ли способ собрать yaml- cpp в Windows, используя Qt Creator?

1 Ответ

0 голосов
/ 17 марта 2020

Хорошо! Я исправил проблему!

Все, что мне нужно было сделать, это удалить C:/devkitPro/msys/bin/ из системного PATH в переменных среды, а затем отключить YAML_CPP_BUILD_TESTS в настройках сборки проектов Qt для yaml- cpp, и это сработало!

По какой-то причине GTest (Google Test Framework) не встраивает MinGW, поэтому имеет такую ​​ошибку.

...