Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Unified Diff: docs/component_build.md

Issue 2686133003: Add a common mistake case for header-only classes in components build doc (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: docs/component_build.md
diff --git a/docs/component_build.md b/docs/component_build.md
index 06341c21cd36e494134db3783d76e5ee184eb612..1de4e4d53e077d1065d6996300a7cc0c12c4155b 100644
--- a/docs/component_build.md
+++ b/docs/component_build.md
@@ -253,3 +253,16 @@ the object file might not be brought into the link. Even if it is brought in
today, it might not be brought in due to completely unrelated changes in the
future. The result will be undefined symbol errors from other components. Use
source sets if your component is made up of more than one target.
+
+### Exporting a symbol that is not linked in your component
brettw 2017/02/09 21:58:44 I think the confusion you ran into is specific to
+
+If an exported symbols is not linked as part of its own component then it is
+not exported by the generated shared library. Other components that expect to
+see this symbol are not be able to find it which results in an undefined symbol
+error:
+
+ some_file.obj : error LNK2001: unresolved external symbol <some definition>
+
+For example this can happen if you have a header-only class that is not used
+inside the module itself. A simple fix in this case is to define the symbol in
+its own .cpp file.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698