Skip to content

Commit b082998

Browse files
committed
Fix MSVC runtime library conflict warning
Add /NODEFAULTLIB:LIBCMT linker flag to resolve LNK4098 warning when building with MSVC. This excludes the static runtime library that conflicts with Crystal's dynamic runtime (/MD).
1 parent d557ff7 commit b082998

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/uing/lib_ui/lib_ui.cr

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ module UIng
1111
@[Link("Windowscodecs")]
1212
@[Link("Uuid")]
1313
@[Link("Winmm")]
14+
# Exclude LIBCMT to avoid conflicts with Crystal's MSVC runtime (/MD).
15+
@[Link(ldflags: "/NODEFAULTLIB:LIBCMT")]
1416
# @[Link(ldflags: "/SUBSYSTEM:WINDOWS")]
1517
{% if flag?(:debug) %}
1618
@[Link(ldflags: "/DEBUG")]

0 commit comments

Comments
 (0)