I am trying to build Python 2.6 for QGIS on RHEL 5. During the making of QGIS I get the following error:
Linking CXX shared library libqgispython.so
/usr/bin/ld:
The following worked for me when I ran into this error:
make clean
./configure CFLAGS=-fPIC CXXFLAGS=-fPIC
I got it working with:
./configure --enable-shared --enable-pic
./configure --help
, possibly piping to grep PIC, to see if there's an option to enable thisIf neither of those work, you need to read the configure code and understand the conditions it tests for better.
The following has an example of passing fPIC to configure
I got it working by adding -fPIC
after CC= gcc -pthread
,
i.e CC= gcc -pthread -fPIC
in the Makefile.
Run configure with --enable-shared
. Then -fPIC
will be included as part of the shared flags.