How do I include <python.h> in libmodbus

40 views
Skip to first unread message

andyts...@gmail.com

unread,
Mar 11, 2015, 2:10:38 AM3/11/15
to libm...@googlegroups.com
Hi all

I am currently running the C version of the libmodbus. I have written a piece of code and the libmodbus was running very well so far. 
However, I would like to incorporate python into the C code (I know libmodbus is available in python too, but I don't want to use it because I am not too familiar with python).  To use call up another piece of python code in C, I would need to include <python.h> as header.

However, when I compile (by typing 'make' in the libmodubs folder), I am having terriable hard time because it says it doesn't link to the python header (namely, <python.h>).  Is there any way for me to change the makefile of libmodbus so that it compiles with <python.h>?

Thank you
Andy

Francisco Ares

unread,
Mar 11, 2015, 7:05:03 AM3/11/15
to libm...@googlegroups.com

--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes "libmodbus".
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse libmodbus+...@googlegroups.com.
Pour obtenir davantage d'options, consultez la page https://groups.google.com/d/optout.


Hi.

What are you using as a build tool chain? Are you sure that the Python header file is accessible by those build tools?

For example, in Linux - at least for the distro I use - I have to specify the Python version, i. e.:

#include <python3.4/Python.h>

If you are using Windows / Visual Studio, make sure that you have setup the include files search path (for all projects or for that single one).

Best regards,
Francisco

Reply all
Reply to author
Forward
0 new messages