Building and linking unix python
Dynamic Python binding for Qt Applications
Brought to you by:
florianlink,
marcusbarann
I have a problem linking to python. My Raspberry Pi came loaded with python 3.2.3. PythonQt requires python 3.3 or higher. I downloaded and built python 3.4.3. After building, I'm not sure if I installed properly. Upon linking to python when building PythonQt, GCC reported "cannot find -lpython3.4m". The python include files are in /usr/python3.4.3/include/python3.4m.
I tweaked python.prf but it had no effect:
I probably should have used a different syntax or set a variable somewhere. What is the proper way to include file?
I think you have to make sure that the path to python3.4m.so is in the LD_LIBRARY_PATH, so that the Gcc can find it.
The python3.4m-config script seems to work, otherwise the Gcc would not complain about not finding python3.4m.
Alternatively, you could specify the paths directly in python.prf using:
INCLUDEPATH += yourpythonpath
LIBS += -lpathtopythonlib
Thank you. As it turns out, I didn't need to tweak python.prf and used the original path settings as-is. Your tip prompted me to look for python3.4m.so which I discovered did not exist. I added the --enable-shared option to python configure and recompiled.
(See https://github.com/docker-library/python/issues/21)