-
|
When compiling my project with ReactPhysics3D, MSVC shows errors relating to std::chrono inside the ReactPhysics3D library: The full log can be found here: https://github.com/Pixels67/Flock/actions/runs/23645398155/job/68876138592 Am I doing things incorrectly? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
The errors you are seeing ( In this specific case, it usually stems from one of three issues: Comparison of Potential Causes
Recommended SolutionI recommend checking for macro/symbol shadowing first. This is a common issue in MSVC environments when combining multiple libraries. If a local variable or a macro is named However, looking at your specific log, it appears the compiler is finding ImplementationUpdate your # 1. Force C++14 or higher
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# 2. Prevent Win32 macro interference (especially important for MSVC)
if(MSVC)
add_compile_definitions(NOMINMAX)
endif()
# 3. Ensure ReactPhysics3D is included correctly via FetchContent or find_package
# ... your existing FetchContent logic ...If the error persists, you can try a "force-include" of the header in your build system to see if it's a simple visibility issue: if(MSVC)
target_compile_options(reactphysics3d PRIVATE /FI"chrono")
endif()Important Check if any of your own files (or other dependencies) have a Does your |
Beta Was this translation helpful? Give feedback.
-
|
After more debugging it was because of Windows header macro conflicts and |
Beta Was this translation helpful? Give feedback.
After more debugging it was because of Windows header macro conflicts and
chrononot being included, I solved it by definingNOMINMAXandWIN32_LEAN_AND_MEAN, and adding#include <chrono>inside DefaultLogger.h.