Skip to content Skip to sidebar Skip to footer

Python Missing Or Unusable Error While Cross Compiling GDB

I get this error while attempting to cross-compile GDB (using the --with-python flag): checking for python: /usr/bin/python checking for python2.7: no configure: error: python is m

Solution 1:

I had the same problem on Debian 6.0 when compiling GDB 7.4.1

The solution was to install python headers

sudo apt-get install python2.6-dev

and then configure with the right flag

./configure --with-python

Solution 2:

I had the same problem with gdb 7.4 and finally made it worked after spending some time debugging.

By checking the file <gdb-source-path>/gdb/config.log, you will notice one line:

configure:11031: gcc -o conftest -g -O2   -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7   conftest.c -lncurses -lz -lm    -L/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config -ldl -framework CoreFoundation -lpython2.7 -u _PyMac_Error Python.framework/Versions/2.7/Python >&5

Seems that the script python/python-config.py returned some invalid flags that caused the gcc command to fail.

The solution is to open <gdb-source-directory>/gdb/python/python-config.py and comment out these two lines:

#            if getvar('LINKFORSHARED') is not None:
#                libs.extend(getvar('LINKFORSHARED').split())

Solution 3:

I just came across a similar issue building gdb 7.8.1 using Continuum's Python 2.7, which, in my case, was installed in a non-standard location.

In this case, the solution was to provide an additional piece of configuration before running 'configure':

export LDFLAGS="-Wl,-rpath,<non-standard-Python-lib-location> -L<non-standard-Python-lib-location>"
configure --with-python=<non-standard-Python-executable-location>

Solution 4:

I hit this error building the ESP8266 SDK. Just did a sudo apt-get install python-dev and now it works.


Post a Comment for "Python Missing Or Unusable Error While Cross Compiling GDB"