Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
pybind11
Commits
90d2f5e2
Commit
90d2f5e2
authored
Apr 11, 2016
by
Wenzel Jakob
Browse files
added a comment about symbol visibility
parent
978e376e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
5 deletions
+25
-5
docs/advanced.rst
docs/advanced.rst
+25
-5
No files found.
docs/advanced.rst
View file @
90d2f5e2
...
...
@@ -1068,11 +1068,11 @@ like so:
Partitioning code over multiple extension modules
=================================================
It's straightforward to split binding code over multiple extension modules,
while
referencing types that are declared elsewhere. Everything "just" works
without any special
precautions. One exception to this rule occurs when
extending a type declared
in another extension module. Recall the basic example
from Section
:ref:`inheritance`.
It's straightforward to split binding code over multiple extension modules,
while
referencing types that are declared elsewhere. Everything "just" works
without any special
precautions. One exception to this rule occurs when
extending a type declared
in another extension module. Recall the basic example
from Section
:ref:`inheritance`.
.. code-block:: cpp
...
...
@@ -1113,6 +1113,26 @@ module ``basic`` has been executed.
Naturally, both methods will fail when there are cyclic dependencies.
Note that compiling code which has its default symbol visibility set to
*hidden* (e.g. via the command line flag ``-fvisibility=hidden`` on GCC/Clang) can interfere with the
ability to access types defined in another extension module. Workarounds
include changing the global symbol visibility (not recommended, because it will
lead unnecessarily large binaries) or manually exporting types that are
accessed by multiple extension modules:
.. code-block:: cpp
#ifdef _WIN32
# define EXPORT_TYPE __declspec(dllexport)
#else
# define EXPORT_TYPE __attribute__ ((visibility("default")))
#endif
class EXPORT_TYPE Dog : public Animal {
...
};
Treating STL data structures as opaque objects
==============================================
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment