Как правильно использовать Cmake из кода Visual Studio?C++

Программы на C++. Форум разработчиков
Ответить
Anonymous
 Как правильно использовать Cmake из кода Visual Studio?

Сообщение Anonymous »

У меня проблемы с получением Cmake для составления базового проекта в коде Visual Studio. Вот ошибка, которую я получаю: < /p>
[driver] Switching to package preset: __defaultPackagePreset__
[driver] Switching to workflow preset: __defaultWorkflowPreset__
[cmake] -- The C compiler identification is unknown
[cmake] -- The CXX compiler identification is unknown
[cmake] CMake Error at CMakeLists.txt:2 (project):
[cmake] The CMAKE_C_COMPILER:
[cmake]
[cmake] C:/msys64/mingw64/bin/gcc.exe
[cmake]
[cmake] is not a full path and was not found in the PATH.
[cmake]
[cmake] Tell CMake where to find the compiler by setting either the environment
[cmake] variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
[cmake] the compiler, or to the compiler name if it is in the PATH.
[cmake]
[cmake]
[cmake] CMake Error at CMakeLists.txt:2 (project):
[cmake] The CMAKE_CXX_COMPILER:
[cmake]
[cmake] C:/msys64/mingw64/bin/g++.exe
[cmake]
[cmake] is not a full path and was not found in the PATH.
[cmake]
[cmake] Tell CMake where to find the compiler by setting either the environment
[cmake] variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
[cmake] to the compiler, or to the compiler name if it is in the PATH.
[cmake]
[cmake]
[cmake] -- Configuring incomplete, errors occurred!
[proc] The command: C:\msys64\usr\bin\cmake.exe -DCMAKE_INSTALL_PREFIX=C:/Users/hanne/Documents/_Projects/LearningCpp/CMake_HelloWorld/out/install/default -DCMAKE_C_COMPILER=C:/msys64/mingw64/bin/gcc.exe -DCMAKE_CXX_COMPILER=C:/msys64/mingw64/bin/g++.exe -DCMAKE_BUILD_TYPE=Debug -SC:/Users/hanne/Documents/_Projects/LearningCpp/CMake_HelloWorld -BC:/Users/hanne/Documents/_Projects/LearningCpp/CMake_HelloWorld/out/build/default -G "Unix Makefiles" exited with code: 1
< /code>
Уведомление о расширении Cmake в VSC говорит следующее: < /p>
Настройка не удалась. Хотели бы вы попытаться настроить с помощью отладчика Cmake? /> Я также подтвердил из терминала, что G ++, GCC и GDB доступны, и подтвердил, что C: \ msys64 \ ucrt64 \ bin и c: \ msys64 \ usr \ bin находятся на моем пути (переменная среды). У меня также есть c: \ cygwin64 \ bin in path, но удаление, казалось, не имело никакого эффекта (также попытался запустить Cmake: Clear Cache и Conerfigure Command, безрезультатно).
Я не понимаю, какова проблема, любые идеи или подсказки, которые могут привести к решению?>

Подробнее здесь: https://stackoverflow.com/questions/795 ... tudio-code
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «C++»