Bug Report: window vs2022 cmake3.25.0无法通过编译
Describe the bug | Bug描述 无法正常编译
Steps to reproduce | 如何复现 Steps to reproduce the behavior:
- 点击build_windows.bat
Expected behavior | 预期行为 A clear and concise description of what you expected to happen.
Actual behavior | 实际行为 A clear and concise description of what actually happened.
Screenshots/Logs | 截图/日志
PS H:\git\github\Piccolo> cmake --build build --config Release
MSBuild version 17.4.0+18d5aef85 for .NET Framework
Checking File Globs
Checking Build System
Building Custom Rule H:/git/github/Piccolo/engine/source/meta_parser/CMakeLists.txt
cursor.cpp
cursor_type.cpp
generator.cpp
reflection_generator.cpp
serializer_generator.cpp
class.cpp
field.cpp
type_info.cpp
main.cpp
meta_info.cpp
meta_utils.cpp
parser.cpp
template_manager.cpp
PiccoloParser.vcxproj -> H:\git\github\Piccolo\engine\bin\PiccoloParser.exe
*************************************************************
**** [Precompile] BEGIN
*************************************************************
Parsing meta data for target "Piccolo"
Parsing in H:/git/github/Piccolo/engine/source
Parsing project file: H:/git/github/Piccolo/engine/bin/precompile.json
Generating the Source Include file: H:/git/github/Piccolo/build/parser_header.h
Parsing the whole project...
Start generate runtime schemas(38)...
Completed in 1175ms
+++ Precompile finished +++
Building Custom Rule H:/git/github/Piccolo/engine/CMakeLists.txt
Building Custom Rule H:/git/github/Piccolo/engine/3rdparty/CMakeLists.txt
Building Custom Rule H:/git/github/Piccolo/engine/3rdparty/JoltPhysics/Build/CMakeLists.txt
pch.cpp
D:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\xlocale(2014): error C2220: 以下警告被视为错误 [H:\g
it\github\Piccolo\build\engine\3rdparty\JoltPhysics\Build\Jolt.vcxproj]
D:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\xlocale(2010): warning C5262: 此处发生隐式失败;是否缺少
中断语句? 当在事例之间有意省略中断语句时,请使用 [[fallthrough]] [H:\git\github\Piccolo\build\engine\3rdparty\JoltPhysics\Build\Jolt.vcxproj]
D:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\xlocale(2010): note: 要简化迁移,请考虑暂 时对用于生成且不引发
警告的编译器版本使用 /Wv:18 标记
D:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\xlocale(2007): note: 可能失败的语句位于此 处
D:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\xlocale(2210): warning C5262: 此处发生隐式失败;是否缺少
中断语句? 当在事例之间有意省略中断语句时,请使用 [[fallthrough]] [H:\git\github\Piccolo\build\engine\3rdparty\JoltPhysics\Build\Jolt.vcxproj]
D:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\xlocale(2210): note: 要简化迁移,请考虑暂 时对用于生成且不引发
警告的编译器版本使用 /Wv:18 标记
D:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\xlocale(2207): note: 可能失败的语句位于此 处
D:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\atomic(917): warning C5262: 此处发生隐式失败;是否缺少中断
语句? 当在事例之间有意省略中断语句时,请使用 [[fallthrough]] [H:\git\github\Piccolo\build\engine\3rdparty\JoltPhysics\Build\Jolt.vcxproj]
D:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\atomic(917): note: 要简化迁移,请考虑暂时
对用于生成且不引发警告
的编译器版本使用 /Wv:18 标记
D:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\atomic(916): note: 可能失败的语句位于此处
D:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\atomic(912): note: 在编译 类 模板 成员函数“void std
::_Atomic_storage<_Ty,4>::store(const long,const std::memory_order) noexcept”时
with
[
_Ty=long
]
D:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\atomic(2767): note: 查看对正在编译的函数 模板 实例化“voi
d std::_Atomic_storage<_Ty,4>::store(const long,const std::memory_order) noexcept”的引用
with
[
_Ty=long
]
D:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\atomic(1417): note: 查看对正在编译的 类 模板 实例化“std
::_Atomic_storage<_Ty,4>”的引用
with
[
_Ty=long
]
D:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\atomic(1607): note: 查看对正在编译的 类 模板 实例化“std
::_Atomic_integral<_Ty,4>”的引用
with
[
_Ty=long
]
D:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\atomic(2085): note: 查看对正在编译的 类 模板 实例化“std
::_Atomic_integral_facade<_Ty>”的引用
with
[
_Ty=long
]
D:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\atomic(2803): note: 查看对正在编译的 类 模板 实例化“std
::atomic<long>”的引用
Generating H:/git/github/Piccolo/engine/shader/generated/spv/axis.frag.spv
H:/git/github/Piccolo/engine/shader/glsl/axis.frag
Generating H:/git/github/Piccolo/engine/shader/generated/spv/axis.vert.spv
H:/git/github/Piccolo/engine/shader/glsl/axis.vert
Generating H:/git/github/Piccolo/engine/shader/generated/spv/color_grading.frag.spv
H:/git/github/Piccolo/engine/shader/glsl/color_grading.frag
Generating H:/git/github/Piccolo/engine/shader/generated/spv/combine_ui.frag.spv
H:/git/github/Piccolo/engine/shader/glsl/combine_ui.frag
Generating H:/git/github/Piccolo/engine/shader/generated/spv/debugdraw.frag.spv
H:/git/github/Piccolo/engine/shader/glsl/debugdraw.frag
Generating H:/git/github/Piccolo/engine/shader/generated/spv/debugdraw.vert.spv
H:/git/github/Piccolo/engine/shader/glsl/debugdraw.vert
Generating H:/git/github/Piccolo/engine/shader/generated/spv/deferred_lighting.frag.spv
H:/git/github/Piccolo/engine/shader/glsl/deferred_lighting.frag
Generating H:/git/github/Piccolo/engine/shader/generated/spv/deferred_lighting.vert.spv
H:/git/github/Piccolo/engine/shader/glsl/deferred_lighting.vert
Generating H:/git/github/Piccolo/engine/shader/generated/spv/fxaa.frag.spv
H:/git/github/Piccolo/engine/shader/glsl/fxaa.frag
Generating H:/git/github/Piccolo/engine/shader/generated/spv/fxaa.vert.spv
H:/git/github/Piccolo/engine/shader/glsl/fxaa.vert
Generating H:/git/github/Piccolo/engine/shader/generated/spv/mesh_directional_light_shadow.frag.spv
H:/git/github/Piccolo/engine/shader/glsl/mesh_directional_light_shadow.frag
Generating H:/git/github/Piccolo/engine/shader/generated/spv/mesh_directional_light_shadow.vert.spv
H:/git/github/Piccolo/engine/shader/glsl/mesh_directional_light_shadow.vert
Generating H:/git/github/Piccolo/engine/shader/generated/spv/mesh.frag.spv
H:/git/github/Piccolo/engine/shader/glsl/mesh.frag
Generating H:/git/github/Piccolo/engine/shader/generated/spv/mesh_gbuffer.frag.spv
H:/git/github/Piccolo/engine/shader/glsl/mesh_gbuffer.frag
Generating H:/git/github/Piccolo/engine/shader/generated/spv/mesh_inefficient_pick.frag.spv
H:/git/github/Piccolo/engine/shader/glsl/mesh_inefficient_pick.frag
Generating H:/git/github/Piccolo/engine/shader/generated/spv/mesh_inefficient_pick.vert.spv
H:/git/github/Piccolo/engine/shader/glsl/mesh_inefficient_pick.vert
Generating H:/git/github/Piccolo/engine/shader/generated/spv/mesh_point_light_shadow.frag.spv
H:/git/github/Piccolo/engine/shader/glsl/mesh_point_light_shadow.frag
Generating H:/git/github/Piccolo/engine/shader/generated/spv/mesh_point_light_shadow.geom.spv
H:/git/github/Piccolo/engine/shader/glsl/mesh_point_light_shadow.geom
Generating H:/git/github/Piccolo/engine/shader/generated/spv/mesh_point_light_shadow.vert.spv
H:/git/github/Piccolo/engine/shader/glsl/mesh_point_light_shadow.vert
Generating H:/git/github/Piccolo/engine/shader/generated/spv/mesh.vert.spv
H:/git/github/Piccolo/engine/shader/glsl/mesh.vert
Generating H:/git/github/Piccolo/engine/shader/generated/spv/particle_emit.comp.spv
H:/git/github/Piccolo/engine/shader/glsl/particle_emit.comp
Generating H:/git/github/Piccolo/engine/shader/generated/spv/particle_kickoff.comp.spv
H:/git/github/Piccolo/engine/shader/glsl/particle_kickoff.comp
Generating H:/git/github/Piccolo/engine/shader/generated/spv/particle_simulate.comp.spv
H:/git/github/Piccolo/engine/shader/glsl/particle_simulate.comp
Generating H:/git/github/Piccolo/engine/shader/generated/spv/particlebillboard.frag.spv
H:/git/github/Piccolo/engine/shader/glsl/particlebillboard.frag
Generating H:/git/github/Piccolo/engine/shader/generated/spv/particlebillboard.vert.spv
H:/git/github/Piccolo/engine/shader/glsl/particlebillboard.vert
Generating H:/git/github/Piccolo/engine/shader/generated/spv/post_process.vert.spv
H:/git/github/Piccolo/engine/shader/glsl/post_process.vert
Generating H:/git/github/Piccolo/engine/shader/generated/spv/skybox.frag.spv
H:/git/github/Piccolo/engine/shader/glsl/skybox.frag
Generating H:/git/github/Piccolo/engine/shader/generated/spv/skybox.vert.spv
H:/git/github/Piccolo/engine/shader/glsl/skybox.vert
Generating H:/git/github/Piccolo/engine/shader/generated/spv/tone_mapping.frag.spv
H:/git/github/Piccolo/engine/shader/glsl/tone_mapping.frag
Building Custom Rule H:/git/github/Piccolo/engine/shader/CMakeLists.txt
Generating H:/git/github/Piccolo/engine/shader/generated/cpp/axis_frag.h
Generating H:/git/github/Piccolo/engine/shader/generated/cpp/axis_vert.h
Generating H:/git/github/Piccolo/engine/shader/generated/cpp/color_grading_frag.h
Generating H:/git/github/Piccolo/engine/shader/generated/cpp/combine_ui_frag.h
Generating H:/git/github/Piccolo/engine/shader/generated/cpp/debugdraw_frag.h
Generating H:/git/github/Piccolo/engine/shader/generated/cpp/debugdraw_vert.h
Generating H:/git/github/Piccolo/engine/shader/generated/cpp/deferred_lighting_frag.h
Generating H:/git/github/Piccolo/engine/shader/generated/cpp/deferred_lighting_vert.h
Generating H:/git/github/Piccolo/engine/shader/generated/cpp/fxaa_frag.h
Generating H:/git/github/Piccolo/engine/shader/generated/cpp/fxaa_vert.h
Generating H:/git/github/Piccolo/engine/shader/generated/cpp/mesh_directional_light_shadow_frag.h
Generating H:/git/github/Piccolo/engine/shader/generated/cpp/mesh_directional_light_shadow_vert.h
Generating H:/git/github/Piccolo/engine/shader/generated/cpp/mesh_frag.h
Generating H:/git/github/Piccolo/engine/shader/generated/cpp/mesh_gbuffer_frag.h
Generating H:/git/github/Piccolo/engine/shader/generated/cpp/mesh_inefficient_pick_frag.h
Generating H:/git/github/Piccolo/engine/shader/generated/cpp/mesh_inefficient_pick_vert.h
Generating H:/git/github/Piccolo/engine/shader/generated/cpp/mesh_point_light_shadow_frag.h
Generating H:/git/github/Piccolo/engine/shader/generated/cpp/mesh_point_light_shadow_geom.h
Generating H:/git/github/Piccolo/engine/shader/generated/cpp/mesh_point_light_shadow_vert.h
Generating H:/git/github/Piccolo/engine/shader/generated/cpp/mesh_vert.h
Generating H:/git/github/Piccolo/engine/shader/generated/cpp/particle_emit_comp.h
Generating H:/git/github/Piccolo/engine/shader/generated/cpp/particle_kickoff_comp.h
Generating H:/git/github/Piccolo/engine/shader/generated/cpp/particle_simulate_comp.h
Generating H:/git/github/Piccolo/engine/shader/generated/cpp/particlebillboard_frag.h
Generating H:/git/github/Piccolo/engine/shader/generated/cpp/particlebillboard_vert.h
Generating H:/git/github/Piccolo/engine/shader/generated/cpp/post_process_vert.h
Generating H:/git/github/Piccolo/engine/shader/generated/cpp/skybox_frag.h
Generating H:/git/github/Piccolo/engine/shader/generated/cpp/skybox_vert.h
Generating H:/git/github/Piccolo/engine/shader/generated/cpp/tone_mapping_frag.h
Building Custom Rule H:/git/github/Piccolo/engine/3rdparty/glfw/src/CMakeLists.txt
context.c
init.c
input.c
monitor.c
vulkan.c
window.c
win32_init.c
win32_joystick.c
win32_monitor.c
win32_time.c
win32_thread.c
win32_window.c
wgl_context.c
egl_context.c
osmesa_context.c
glfw.vcxproj -> H:\git\github\Piccolo\build\engine\3rdparty\glfw\src\Release\glfw3.lib
Building Custom Rule H:/git/github/Piccolo/engine/3rdparty/CMakeLists.txt
imgui.cpp
imgui_demo.cpp
imgui_draw.cpp
imgui_tables.cpp
imgui_widgets.cpp
imgui_impl_glfw.cpp
imgui_impl_vulkan.cpp
imgui.vcxproj -> H:\git\github\Piccolo\build\engine\3rdparty\Release\imgui.lib
Building Custom Rule H:/git/github/Piccolo/engine/source/runtime/CMakeLists.txt
json11.cpp
json11.vcxproj -> H:\git\github\Piccolo\build\engine\source\runtime\Release\json11.lib
Building Custom Rule H:/git/github/Piccolo/engine/3rdparty/spdlog/CMakeLists.txt
spdlog.cpp
stdout_sinks.cpp
color_sinks.cpp
file_sinks.cpp
async.cpp
cfg.cpp
fmt.cpp
spdlog.vcxproj -> H:\git\github\Piccolo\build\engine\3rdparty\spdlog\Release\spdlog.lib
Building Custom Rule H:/git/github/Piccolo/engine/3rdparty/tinyobjloader/CMakeLists.txt
tiny_obj_loader.cc
tinyobjloader.vcxproj -> H:\git\github\Piccolo\build\engine\3rdparty\tinyobjloader\Release\tinyobjloader.lib
Desktop | 桌面环境
- OS: Windows
- Version Win10,
- CPU Intel I7-9代
- GPU 1660ti Max-
- Memory 16GB
- Compiler (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 8.1.0
Additional context | 补充信息 Add any other context about the problem here.
根据#390
将 engine\3rdparty\JoltPhysics\Build\CMakeLists.txt 45行中 /WX 替换成 /Wv:18 解决
Thank you, the same problem.
Thank you, the same problem.
Thank you, the same problem.
Thank you, the same problem.
替换后,有新的问题出现了,而且引擎不能开起来
20>LINK : warning LNK4098: 默认库“MSVCRT”与其他库的使用冲突;请使用 /NODEFAULTLIB:library 20>PiccoloEditor.vcxproj -> D:\Learn_Code\piccolo\Piccolo-main\build\engine\source\editor\Debug\PiccoloEditor.exe