Skip to content

Suppress C4251 warnings in QuantLib DLL builds#5

Merged
fumitoh merged 1 commit intomainfrom
claude/suppress-c4251-warning-0m9Tv
Feb 22, 2026
Merged

Suppress C4251 warnings in QuantLib DLL builds#5
fumitoh merged 1 commit intomainfrom
claude/suppress-c4251-warning-0m9Tv

Conversation

@fumitoh
Copy link
Member

@fumitoh fumitoh commented Feb 22, 2026

Summary

Updated the QuantLib DLL build script to suppress C4251 compiler warnings that occur when STL types are used in DLL-exported class members.

Changes

  • Modified the Platform.cmake patch in Build-QuantLibDLL.ps1 to add a compile option that suppresses the C4251 warning (/wd4251) in addition to removing the FATAL_ERROR that blocks DLL builds
  • Updated the documentation comment to reflect that the patch now handles both the FATAL_ERROR removal and C4251 warning suppression

Details

The C4251 warning is a common issue when building DLLs with MSVC, as it warns about STL container types being used in exported class members. By adding add_compile_options(/wd4251) to the patched Platform.cmake, the build process will no longer emit these warnings, resulting in cleaner build output while maintaining the functionality of DLL builds on MSVC.

https://claude.ai/code/session_012RnYmE4NKFQ4NjtbkQANzF

Inject `add_compile_options(/wd4251)` into cmake/Platform.cmake during
patching.  C4251 fires for every class member using STL types in a
DLL-exported class; with CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON these
warnings are harmless noise that drowns out real diagnostics.

https://claude.ai/code/session_012RnYmE4NKFQ4NjtbkQANzF
@fumitoh fumitoh merged commit 8efb225 into main Feb 22, 2026
0 of 2 checks passed
@fumitoh fumitoh deleted the claude/suppress-c4251-warning-0m9Tv branch February 25, 2026 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants