-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Static linking using Cmake #466
Comments
Python extension modules have to be dynamic. However, you can have a dynamic pybind11 module that links to a static library. Best,
|
I am linking using CMake, following the docs example:
When running make, I get the following error:
If I understand correctly, it tries to do dynamic linking with the dlib library which is compiled for static linking. How can I request static linking with the dlib library when creating the pyface module? Thanks, |
Add the following line to enable set_target_properties(dlib PROPERTIES POSITION_INDEPENDENT_CODE TRUE) Note that this really isn't specific to pybind11. It's general build system and linking for any dynamic library. |
How to link pybind11 module that links to a static library? I tried TARGET_LINK_LIBRARIES but I seem to be using it wrongly. |
Thank you so much sir |
Hi,
I am trying to (cmake) compile a binding to a library that uses a another library (dlib). This library is compiled for static linking. Is it possible to set pybind11 to use static linking?
Thanks,
Amit
The text was updated successfully, but these errors were encountered: