Fix Windows MSVC iostream linking failure in BeamLatticeVoxelAcceleration tests #9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes a Windows MSVC build failure where the linker could not resolve
std::basic_ostreamsymbols when buildingBeamLatticeVoxelAcceleration_tests.cpp. The error manifested as:Root Cause
The issue was caused by conflicting linker subsystem flags in the Windows build. The build logs showed both
/SUBSYSTEM:WINDOWSand/subsystem:consolebeing applied simultaneously:This invalid configuration prevented proper iostream symbol linkage. The main CMakeLists.txt sets
CMAKE_EXE_LINKER_FLAGSto include/SUBSYSTEM:WINDOWSglobally, but test executables require console I/O forstd::coutoperations used extensively in the test suite.Solution
Fixed subsystem conflict: Override the global Windows subsystem setting specifically for test executables:
Explicit C++20 standard: Ensure unit tests match integration test configuration:
Complete dependency chain: Added all required source files for the BeamLatticeVoxelAcceleration functionality:
BeamLatticeVoxelAcceleration.h/cpp- main voxel acceleration implementationBeamLatticeVoxelAccelerationReference.h/cpp- reference implementation for testingBeamLatticeResource.h/cppandBeamBVH.h/cpp- required dependenciesThe issue was specific to this test file because it combines complex template usage (
measureExecutionTime<Func>), extensive iostream formatting operations, C++17 structured bindings, and heavystd::coutusage that triggered more template instantiations than simpler test files.Fixes #8.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.