Skip to content

Conversation

@Elvis339
Copy link
Contributor

@Elvis339 Elvis339 commented Jan 2, 2026

On Windows with MSVC, linking against stdc++ fails because it is a GNU/GCC library that does not exist in the MSVC toolchain. MSVC uses its own C++ runtime which is linked automatically.

This fix wraps the stdc++ link directive in a target check, matching the existing pattern in candle-flash-attn/build.rs.

Fixes #3277

On Windows with MSVC, linking against stdc++ fails because it is a
GNU/GCC library that does not exist in the MSVC toolchain. MSVC uses
its own C++ runtime which is linked automatically.

This fix wraps the stdc++ link directive in a target check, matching
the existing pattern in candle-flash-attn/build.rs.

Fixes huggingface#3277
Copy link
Member

@ivarflakstad ivarflakstad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! 👌

@ivarflakstad ivarflakstad merged commit 43be23c into huggingface:main Jan 3, 2026
9 checks passed
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.

fatal error LNK1181: cannot open input file 'stdc++.lib'

2 participants