# Error linking shared library

**URL:** <https://root-forum.cern.ch/t/error-linking-shared-library/20279>\
**Category:** ROOT\
**Created:** [December 1, 2015, 10:08am UTC](https://root-forum.cern.ch/t/error-linking-shared-library/20279 "2015-12-01T10:08:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![abhi](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/b487fb/32.png) [@abhi](https://root-forum.cern.ch/u/abhi)\
**Post date:** [December 1, 2015, 10:08am UTC](https://root-forum.cern.ch/t/error-linking-shared-library/20279/1 "2015-12-01T10:08:22Z")

</div>

Hi everyone. I am new to ubuntu so forgive me if my question is silly.  
I am installing root v5-34-21 and I am having 2 problems:

1. When I type `./configure --all --enable-shared` it goes into an infinite loop.

2. When i terminate it in the middle after i see the message “to build root: type make” and type make -j4 it compiles till 97% and then gives the following error:

```auto
[b]Linking CXX shared library ../../lib/libPyROOT.so
/usr/bin/ld: /usr/local/lib/libpython2.7.a(myreadline.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libpython2.7.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [lib/libPyROOT.so] Error 1
make[1]: *** [bindings/pyroot/CMakeFiles/PyROOT.dir/all] Error 2
make: *** [all] Error 2[/b]

```

Can anyone please help me?  
Thanks.

---

<div class="post-metadata">

**Author:** ![Danilo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/danilo/32/34528_2.png) [@Danilo](https://root-forum.cern.ch/u/Danilo)\
**Post date:** [December 1, 2015, 9:01pm UTC](https://root-forum.cern.ch/t/error-linking-shared-library/20279/2 "2015-12-01T21:01:32Z")

</div>

Hi,

on what operating system are you?  
If you are on linux, do you have a python shared library somewhere ([libpython2.7.so](http://libpython2.7.so))?  
The issue is linked to the fact that libpython does not provide position independent code. A cause could be a statically linked python.

Cheers,  
Danilo

---

<div class="post-metadata">

**Author:** ![ning\_cao](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ning_cao/32/27420_2.png) [@ning\_cao](https://root-forum.cern.ch/u/ning_cao)\
**Post date:** [May 30, 2018, 12:47pm UTC](https://root-forum.cern.ch/t/error-linking-shared-library/20279/3 "2018-05-30T12:47:16Z")

</div>

Hi,

I met this problem, too.  
Did you get this problem solved?

Nim

---

<div class="post-metadata">

**Author:** ![Axel](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/axel/32/11084_2.png) [@Axel](https://root-forum.cern.ch/u/Axel)\
**Post date:** [June 1, 2018, 11:29am UTC](https://root-forum.cern.ch/t/error-linking-shared-library/20279/4 "2018-06-01T11:29:03Z")

</div>

Next time, please open a new topic, instead of resurrecting a very old one.

As Danilo says, please make sure to link against the python _shared_ library (.so) and not the static one (.a).
