C++ on Vistual Studio with CMake错误:manifest 'build,忍者'仍然脏后100次尝试

pb3skfrl  于 2023-05-02  发布在  其他
关注(0)|答案(1)|浏览(193)

我的CMakeLists。txt看起来像下面这样(我不认为CMakeLists的内容。txt很重要,因为代码在Linux上可以很好地与CLion编译,但包括细节应该不会有任何伤害):

cmake_minimum_required(VERSION 3.12)
project(ambulance)

set(CMAKE_CXX_STANDARD 14)
if (UNIX)
    set(CMAKE_CXX_FLAGS " -pthread ")

    include_directories(ambulance builder control include include/unix io main model view)

    add_executable(ambulance
            control/Ambulance.cpp
            control/Ambulance.h
            main/main.cpp
            view/AmbulanceUI.cpp
            view/AmbulanceUI.h
            model/Doctor.cpp
            model/Doctor.h
            model/Patient.cpp
            model/Patient.h
            control/PatientAdmin.cpp
            control/PatientAdmin.h
            model/Person.cpp
            model/Person.h
            control/DoctorAdmin.cpp
            control/DoctorAdmin.h
            model/Treatment.cpp
            model/Treatment.h
            io/PeopleIO.h
            io/AmbulancePersistence.cpp
            io/AmbulancePersistence.h
            io/AmbulancePeopleIOElement.cpp
            io/AmbulancePeopleIOElement.h
            builder/PatientBuilder.cpp
            builder/PatientBuilder.h
            builder/DoctorBuilder.cpp
            builder/DoctorBuilder.h
            builder/PersonBuilder.cpp
            builder/PersonBuilder.h
            include/json_macro.h
            include/system_macro.h
            control/ScheduleAdmin.cpp
            control/ScheduleAdmin.h
            model/ScheduleElement.cpp
            model/ScheduleElement.h
            model/DailySchedule.cpp
            model/DailySchedule.h
            include/unix/Logger.h
            include/unix/Logger.cpp
            include/json.hpp
            logger/Logger.h
            logger/Logger.cpp)
else ()
    include_directories(ambulance builder control include include/win io main model view)

    add_executable(ambulance
            include/json.hpp
            control/Ambulance.cpp
            control/Ambulance.h
            main/main.cpp
            view/AmbulanceUI.cpp
            view/AmbulanceUI.h
            model/Doctor.cpp
            model/Doctor.h
            model/Patient.cpp
            model/Patient.h
            control/PatientAdmin.cpp
            control/PatientAdmin.h
            model/Person.cpp
            model/Person.h
            control/DoctorAdmin.cpp
            control/DoctorAdmin.h
            model/Treatment.cpp
            model/Treatment.h
            io/PeopleIO.h
            io/AmbulancePersistence.cpp
            io/AmbulancePersistence.h
            io/AmbulancePeopleIOElement.cpp
            io/AmbulancePeopleIOElement.h
            builder/PatientBuilder.cpp
            builder/PatientBuilder.h
            builder/DoctorBuilder.cpp
            builder/DoctorBuilder.h
            builder/PersonBuilder.cpp
            builder/PersonBuilder.h
            include/json_macro.h
            include/system_macro.h
            include/win/Logger.h
            include/win/Logger.cpp
            control/ScheduleAdmin.cpp
            control/ScheduleAdmin.h
            model/ScheduleElement.cpp
            model/ScheduleElement.h
            model/DailySchedule.cpp
            model/DailySchedule.h
            logger/Logger.cpp
            logger/Logger.h)
endif (UNIX)

这里是CMakeSettings的内容。文本

{
"configurations": [
{
"name": "x64-Release",
"generator": "Ninja",
"configurationType": "RelWithDebInfo",
"inheritEnvironments": [
"msvc_x64_x64"
],
"buildRoot": "${env.USERPROFILE}\CMakeBuilds\${workspaceHash}\build\${name}",
"installRoot": "${env.USERPROFILE}\CMakeBuilds\${workspaceHash}\install\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "-v",
"ctestCommandArgs": ""
}
]
}

我主要在Linux上编写代码,并使用Visual Studio Enterprise在虚拟Windows 10机器上编译。昨天的构建仍然是成功的,但是从今天开始,每次我试图编译它,我都有一个无休止的循环,它说:
[0/1]“... cmak.exe”“.../x64-Release”--配置完成--生成完成--构建文件已写入:...
最后,错误描述说:
manifest 'build。忍者'仍然脏后100次尝试
有什么办法可以解决这个问题?我必须重新安装Visual Studio(什么是令人难以置信的不舒服,因为我的虚拟机是令人难以置信的慢)。
谢谢你

jyztefdp

jyztefdp1#

我也遇到了同样的问题。在我的例子中,运行一个递归地设置源文件夹(source,不是build文件夹)上所有文件时间戳的工具很有帮助。我假设某个工具将其中一个源文件更新到了未来的某个时间,这使得cmake认为它必须重新生成,因为源文件比构建文件新。也许这对你也有帮助?
这是我使用的工具:http://web.archive.org/web/20101226014112/www.touchdotexe.com/
在命令行中使用它:

touch.exe -R C:/my/source/folder

相关问题