Wie setzen cmake-CXX-variable auf windows
Ich erhalte die folgende Fehlermeldung
Arbeiten: Microsoft Windows [Versión 6.1.7601]
Fehler:
CMake Warning at CMakeLists.txt:4 (project):
To use the NMake generator, cmake must be run from a shell that can use the
compiler cl from the command line. This environment does not contain
INCLUDE, LIB, or LIBPATH, and these must be set for the cl compiler to
work.
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:4 (project):
The CMAKE_C_COMPILER:
cl
is not a full path and was not found in the PATH.
Tell CMake where to find the compiler by setting either the environment
variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
the compiler, or to the compiler name if it is in the PATH.
CMake Error at CMakeLists.txt:4 (project):
The CMAKE_CXX_COMPILER:
cl
is not a full path and was not found in the PATH.
Tell CMake where to find the compiler by setting either the environment
variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.
-- Configuring incomplete, errors occurred!
Wenn somone helfen kann...
InformationsquelleAutor user3808307 | 2015-07-25
Du musst angemeldet sein, um einen Kommentar abzugeben.
Müssen Sie führen Sie das batch-Skript zur Verfügung gestellt von Visual Studio, um Ihre Umgebung vor dem ausführen cmake. Es ist unter
X:\Visual\Studio\Dir\VC\vcvarsall.bat
. Es sollte auch eine Verknüpfung im start-Menü für "Visual Studio Eingabeaufforderung", öffnen Sie eine Eingabeaufforderung und starten automatischvcvarsall.bat
.InformationsquelleAutor Miles Budnek
Versuchen, zu verwenden "Visual Studio Eingabeaufforderung" (vcvarsall.bat)
InformationsquelleAutor Anton Malyshev
Als andere gesagt, Sie können entweder cmake in der "Visual Studio Eingabeaufforderung" - form, die den Pfad @Miles sagte: oder (bessere Möglichkeit) den Pfad der visual studio-compiler auf Ihrem Weg. Schauen Sie diesem Pfad:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin
- und finden es in Ihrem computer, dann fügen Sie es in Ihre PATH-Umgebungsvariable.Ich installierte visual studio 14.0 aber die Datei ist da nicht. Es gibt keine vcvarsall überall zu finden. Ich denke, ich werde geben, bis auf diese, die ich versucht habe zu installieren, etwas über eine Woche. Ich Wechsel zu ubuntu und versuchen Sie es dort. Vielen Dank an alle die antworteten
prüfen Sie diese Datei, wenn vorhanden:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\cl.exe
Wenn es existierte, müssen Sie nur fügen Sie es in Ihre PATH-Umgebungsvariable. Aber natürlich ist Linux viel einfacher für die Programmierer 🙂Nein, es muss nicht Die exe-Dateien habe ich im Verzeichnis bin sind bscmake, cvtres, mspdbrsv, nmake, undname, und xdcmake
InformationsquelleAutor e_soroush
Ich lief in das gleiche problem. Ich erkannte, dass cl nicht mit Visual Studio 2015, aber wenn ich installierte die 2013 express, es funktionierte.
Verwenden Sie die "Visual Studio 2013" -> "Visual Studio Tools" -> "VS2013 x 64 Cross Tools-Eingabeaufforderung".
InformationsquelleAutor danielbathke
Bitte beachten Sie, dass ich das problem gelöst werden, indem diese meine PATH-Umgebungsvariable, wo ich Visual Studio 2019 installiert:
InformationsquelleAutor user8128167