Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pybind11
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
pybind11
Commits
90d2f5e2
Commit
90d2f5e2
authored
Apr 11, 2016
by
Wenzel Jakob
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added a comment about symbol visibility
parent
978e376e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
5 deletions
+25
-5
docs/advanced.rst
+25
-5
No files found.
docs/advanced.rst
View file @
90d2f5e2
...
@@ -1068,11 +1068,11 @@ like so:
...
@@ -1068,11 +1068,11 @@ like so:
Partitioning code over multiple extension modules
Partitioning code over multiple extension modules
=================================================
=================================================
It's straightforward to split binding code over multiple extension modules,
while
It's straightforward to split binding code over multiple extension modules,
referencing types that are declared elsewhere. Everything "just" works without any special
while referencing types that are declared elsewhere. Everything "just" works
precautions. One exception to this rule occurs when extending a type declared
without any special precautions. One exception to this rule occurs when
in another extension module. Recall the basic example from Section
extending a type declared in another extension module. Recall the basic example
:ref:`inheritance`.
from Section
:ref:`inheritance`.
.. code-block:: cpp
.. code-block:: cpp
...
@@ -1113,6 +1113,26 @@ module ``basic`` has been executed.
...
@@ -1113,6 +1113,26 @@ module ``basic`` has been executed.
Naturally, both methods will fail when there are cyclic dependencies.
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
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