# Build Error:libpython2.7.so: undefined reference to \`minor

**URL:** <https://discourse.slicer.org/t/build-error-libpython2-7-so-undefined-reference-to-minor/6470>\
**Category:** Support\
**Tags:** build\
**Created:** [April 11, 2019, 2:01pm UTC](https://discourse.slicer.org/t/build-error-libpython2-7-so-undefined-reference-to-minor/6470 "2019-04-11T14:01:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ranglage](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ranglage/32/16323_2.png) [@Ranglage](https://discourse.slicer.org/u/Ranglage)\
**Post date:** [April 11, 2019, 2:01pm UTC](https://discourse.slicer.org/t/build-error-libpython2-7-so-undefined-reference-to-minor/6470/1 "2019-04-11T14:01:42Z")

</div>

When I build the latest Slicer source from Github  
I got these errors:  
[43%] Linking C shared library …/…/…/lib/python2.7/lib-dynload/\_hashlib.so  
[44%] Built target extension\_hashlib  
[44%] Linking C shared library …/…/…/lib/python2.7/lib-dynload/\_ssl.so  
[45%] Built target extension\_ssl  
[45%] Built target extension\_zlib  
[91%] Built target libpython-shared  
[97%] Built target pgen  
[97%] Linking C executable …/…/bin/python  
Creating ‘bin/./Modules/Setup.local’  
/usr/bin/ld: …/…/lib/libpython2.7.so: undefined reference to `minor' /usr/bin/ld: ../../lib/libpython2.7.so: undefined reference to`major’  
/usr/bin/ld: …/…/lib/libpython2.7.so: undefined reference to `makedev’  
collect2: error: ld returned 1 exit status  
make[5]: \*\*\* [CMakeBuild/python/CMakeFiles/python.dir/build.make:92: bin/python] Error 1  
make[4]: \*\*\* [CMakeFiles/Makefile2:4311: CMakeBuild/python/CMakeFiles/python.dir/all] Error 2  
make[3]: \*\*\* [Makefile:141: all] Error 2  
make[2]: \*\*\* [CMakeFiles/python.dir/build.make:119: python-prefix/src/python-stamp/python-build] Error 2  
make[1]: \*\*\* [CMakeFiles/Makefile2:1431: CMakeFiles/python.dir/all] Error 2  
make: \*\*\* [Makefile:95: all] Error 2

OS:Ubuntu18.10  
QT:5.12.2  
Cmake:3.14.1

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [April 11, 2019, 2:38pm UTC](https://discourse.slicer.org/t/build-error-libpython2-7-so-undefined-reference-to-minor/6470/2 "2019-04-11T14:38:06Z")

</div>

Thanks for reporting the problem.

Two approaches to move forward:

(1) build [https://github.com/python-cmake-buildsystem/python-cmake-buildsystem](https://github.com/python-cmake-buildsystem/python-cmake-buildsystem) specifying options `-DPYTHON_VERSION:STRING=2.7.15` and `-DBUILD_LIBPYTHON_SHARED:BOOL=1` and report issue in the associated tracker.

(2) Waiting this is addressed, you could also try building the branch `python3-support` ? See [https://github.com/Slicer/Slicer/pull/1118](https://github.com/Slicer/Slicer/pull/1118)

Since we will very soon switch to Python3 (most likely today), testing this would also be helpful.
