0

I'm trying to implement an extension that requires use of external libraries. How can I configure include files, libraries and the path where dynamic libraries should be found?

I've tried not adding these parameters and it seems compiling without any error but then, if I try to import the module, I obtain a segmentation fault error probably due to something lacking in configuration settings or setup.py.

Francesco Argese
  • 626
  • 4
  • 11
  • 1
    This is compiler specific... Which one are you using? – Aconcagua Dec 12 '17 at 08:56
  • I'm using g++ on Ubuntu. – Francesco Argese Dec 12 '17 at 09:23
  • Suppose [this](https://stackoverflow.com/a/20728782/1312382) is what you are after? – Aconcagua Dec 12 '17 at 09:42
  • Possible duplicate of [Telling gcc directly to link a library statically](https://stackoverflow.com/questions/6578484/telling-gcc-directly-to-link-a-library-statically) – Aconcagua Dec 12 '17 at 09:43
  • @Aconcagua I need to set it using setup.py in order to compile the CPython extension. I don't think it is a duplicate of the post you cited. – Francesco Argese Dec 12 '17 at 10:07
  • 1
    Following the [documentation](https://docs.python.org/3/distutils/setupscript.html#library-options), try naming the libraries with a leading colon, probably you then need to add the library ending. If not working, you should be able to use the [extra_link_args](https://docs.python.org/3/distutils/setupscript.html#other-options) for this purpose. – Aconcagua Dec 12 '17 at 10:25

0 Answers0