Skip to content

No need to pass C++ library#73

Merged
arnetheduck merged 1 commit intomainfrom
cpplib
Mar 23, 2026
Merged

No need to pass C++ library#73
arnetheduck merged 1 commit intomainfrom
cpplib

Conversation

@arnetheduck
Copy link
Contributor

@arnetheduck arnetheduck commented Mar 23, 2026

C++ compilers will choose this themselves - which one is used depends on how the C++ compiler is configured, not the platform - if the wrong one is passed in, as happens for clang+windows (which uses -lc++), the application using lsquic fails to link due to duplicate symbols

C++ compiler will choose this themselves - which one is used depends on
how the C++ compiler is configured, not the platform
@arnetheduck arnetheduck requested a review from a team as a code owner March 23, 2026 10:18
@arnetheduck arnetheduck requested review from gmelodie and richard-ramos and removed request for a team March 23, 2026 10:18
@arnetheduck
Copy link
Contributor Author

Notably, -l is a linker flag, typically passed in with {.passl.} - but more importantly, as long as the C++ compiler is used to link the final output, the c++ std lib will automatically be chosen correctly.

The trick is to use C++ to link - nim does this automatically when running nim c ... but if makefiles etc are used for the final linking, one needs to be a bit more careful and not accidentally use a c compiler driver for the linking.

@arnetheduck arnetheduck merged commit 993faa2 into main Mar 23, 2026
16 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.

2 participants