-
Notifications
You must be signed in to change notification settings - Fork 17.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/cgo: documentation missing for C++ #6393
Labels
Milestone
Comments
I believe that what that CL implemented is support for compiling .cc files and linking them into the program. Cgo per se still does not know about C++, in that you cannot refer to C.cout or anything like that. The new support only helps if you have a plain C header file implemented by C++ code. |
What CL 8248043 did was, in effect, support using .cc files in much the same way we support using .c files. As far as I can tell we currently don't document the handling of .c files at all. It's not clear to me where this should be documented. This isn't a part of the cgo tool as such. It's the go tool that picks up .c (and now .cc) files. There is an interaction between the go tool and the cgo tool that is not documented anywhere as far as I know; the go tool treats .c files differently if the package uses cgo. Here is what is new in 1.2: if a package uses cgo, then any .cc files will be compiled with the C++ compiler and included in the package. There is another change that is probably not worth documenting: when linking a binary, if any package uses cgo and has a .cc file, then the C++ compiler will be used as the external linker (external linking is documented as part of cgo internals). |
Owner changed to @ianlancetaylor. Status changed to Started. |
This issue was closed by revision acae4d2. Status changed to Fixed. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The text was updated successfully, but these errors were encountered: