我只是想不通为什么我会收到这个错误,有人介意给我一些帮助吗?
我已将 Cmake 添加到环境变量中,但仍然出现错误。我目前是一名试图让 SDL 工作的大学生。
我的机器是 x64,我有安装了所有 C++ 元素的 Visual Studio 2017。
这是 CMD 错误: CMD 错误
这是 GUI 错误: GUI 错误
复制 - 粘贴 CMD 版本:
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:1 (PROJECT):
No CMAKE_C_COMPILER could be found.
CMake Error at CMakeLists.txt:1 (PROJECT):
No CMAKE_CXX_COMPILER could be found.
-- Configuring incomplete, errors occurred!
See also "C:/Users/Chris Ross/.conan/data/zlib/1.2.8/lasote/stable/build/6cc50b139b9c3d27b3e9042d5f5372d327b3a9f7/_build/CMakeFiles/CMakeOutput.log".
See also "C:/Users/Chris Ross/.conan/data/zlib/1.2.8/lasote/stable/build/6cc50b139b9c3d27b3e9042d5f5372d327b3a9f7/_build/CMakeFiles/CMakeError.log".
zlib/1.2.8@lasote/stable:
zlib/1.2.8@lasote/stable: ERROR: Package '6cc50b139b9c3d27b3e9042d5f5372d327b3a9f7' build failed
zlib/1.2.8@lasote/stable: WARN: Build folder C:\Users\Chris Ross\.conan\data\zlib\1.2.8\lasote\stable\build\6cc50b139b9c3d27b3e9042d5f5372d327b3a9f7
ERROR: zlib/1.2.8@lasote/stable: Error in build() method, line 60
self.run('%s && cmake .. %s' % (cd_build, cmake.command_line))
ConanException: Error 1 while executing cd _build && cmake .. -G "Visual Studio 15 2017 Win64" -DCONAN_LINK_RUNTIME="/MD" -DCONAN_EXPORTED="1" -DCONAN_COMPILER="Visual Studio" -DCONAN_COMPILER_VERSION="15" -DCONAN_CXX_FLAGS="/MP4" -DCONAN_C_FLAGS="/MP4" -Wno-dev
INFO: Conan job finished.
INFO: Starting cmake
CMake Error: Error: generator : Visual Studio 14 2015 Win64
Does not match the generator used previously: Visual Studio 15 2017 Win64
Either remove the CMakeCache.txt file and CMakeFiles directory or choose a different binary directory.
INFO: CMake job finished.
复制 - 粘贴 GUI 版本:
CMAKE_CONFIGURATION_TYPES Debug;Release;MinSizeRel;RelWithDebInfo
CMAKE_INSTALL_PREFIX C:/Program Files (x86)/lab1
Configuring incomplete, errors occurred!
See also "C:/Users/Chris Ross/Desktop/lab2template/bin/CMakeFiles/CMakeOutput.log".
See also "C:/Users/Chris Ross/Desktop/lab2template/bin/CMakeFiles/CMakeError.log".
我的 conanfile.txt:
[requires]
SDL2/2.0.5@dotfloat/stable
SDL2_image/2.0.1@lasote/stable
SDL2_mixer/2.0.1@a_teammate/testing
SDL2_ttf/2.0.14@hilborn/stable
[options]
SDL2:shared=True
SDL2_image:shared=False
SDL2_mixer:shared=True
SDL2_ttf:shared=False
[generators]
cmake
[imports]
bin, *.dll -> ./bin # Copies all dll files from packages bin folder to my "bin" folder
lib, *.dylib* -> ./bin # Cop
使用这个 .bat 文件:
@echo off
:start
echo INFO: I am running from '%cd%'
if exist src goto changetobin
:conan
echo INFO: Starting conan
conan install --build missing
echo INFO: Conan job finished.
goto cmake
:cmake
echo INFO: Starting cmake
cmake .. -G "Visual Studio 14 2015 Win64"
echo INFO: CMake job finished.
goto end
:changetobin
echo ERROR: I'm in the wrong directory.. moving into bin
cd bin
echo INFO: Retrying..
goto start
:end
if exist bin goto quit
cd ..
goto quit
:quit
echo.
echo.
echo INFO: Conan and CMake ran successfully. Open up your solution file (listed below) to open your project.
echo.
dir /b *.sln
(我也尝试过手动构建(conan install --build 缺失))