Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd c++ linking example #318
Conversation
j-haj
suggested changes
Oct 6, 2017
|
Overall I think this looks really good! Great work! I only have one nitpick on wording.. |
|
|
||
| [![cc-badge]][cc] [![cat-development-tools-badge]][cat-development-tools] | ||
|
|
||
| Linking a bundled C++ library is almost the same as linking it with a C library. The main difference is the [`cpp`][cc-build-cpp] option that should be put to `true` and the addition of `extern "C"` in the foo.cpp file. |
This comment has been minimized.
This comment has been minimized.
j-haj
Oct 6, 2017
Contributor
Just a few nitpicks here. I think there is room to improve the clarity of these sentences.
Linking a bundled C++ library is almost the same as linking it with a C library.
I would reword this. I understand what you are saying here, but the use of "it" here technically refers to the bundled C++ library, although it seems you are using it to refer to the compiled binary. Something along the lines of "Linking a bundled C++ library is very similar to linking a bundled C library."
The main difference is the [
cpp][cc-build-cpp] option that should be put totrueand the addition ofextern "C"in the foo.cpp file.
I would reword this as well. cpp(true) is a method used as part of the Builder pattern, not technically an option. I would reword to something along these lines:
"The two core differences when compiling and statically linking a bundled C++ library are specifying a C++ compiler via the builder method cpp(true) and preventing name mangling by the C++ compiler by adding the extern "C" section at the top of our C++ source file.
This comment has been minimized.
This comment has been minimized.
thibaultbarbie
Oct 7, 2017
Author
Contributor
Thanks for your suggestion! I agree it is a far better explanation now.
budziq
merged commit b844035
into
rust-lang-nursery:master
Oct 7, 2017
This comment has been minimized.
This comment has been minimized.
|
Nicely done @thibaultbarbie ! Thanks for the great help @j-haj ! |
thibaultbarbie commentedOct 5, 2017
I added an example for the compilation and linking of a bundled C++ library (#296).