cmd/cgo: fix C linker problems when linking C++ static libraries #40594
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Currently, if I link a static library containing C++ files, Go can't tell the difference and uses the C linker for example gcc.exe (not g++.exe), which causes the standard C++ libraries to not be linked.
I can think of 2 ways to fix this.
Either add a "#cgo: c++" directive that tells Go that this is a C++ package, or just always use the C++ linker.
The text was updated successfully, but these errors were encountered: