# Compile Error on Ubuntu 18.04

**URL:** <https://root-forum.cern.ch/t/compile-error-on-ubuntu-18-04/31136>\
**Category:** Newbie\
**Created:** [October 16, 2018, 11:01pm UTC](https://root-forum.cern.ch/t/compile-error-on-ubuntu-18-04/31136 "2018-10-16T23:01:35Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![mp2u](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/97f17d/32.png) [@mp2u](https://root-forum.cern.ch/u/mp2u)\
**Post date:** [October 16, 2018, 11:01pm UTC](https://root-forum.cern.ch/t/compile-error-on-ubuntu-18-04/31136/1 "2018-10-16T23:01:35Z")

</div>

Ubuntu 18.04  
gcc 4.8.5  
root version 5.34/36

This error came up when attempting to compile.

g++ -pipe -m64 -Wshadow -Wall -W -Woverloaded-virtual -fPIC -Iinclude -pthread -I. -I/home/manuel/root/cint/cint/inc -o graf2d/fitsio/src/G\_\_FITSIO.o -c graf2d/fitsio/src/G\_\_FITSIO.cxx  
g++ -shared -Wl,-soname,libFITSIO.so -m64 -O2 -Wl,–no-undefined -Wl,–as-needed -o lib/libFITSIO.so graf2d/fitsio/src/TFITS.o graf2d/fitsio/src/G\_\_FITSIO.o -Llib -lCore -lCint -ldl -Llib -lHist -lGpad -lGraf -lMatrix /usr/lib/x86\_64-linux-gnu/libcfitsio.a -lpthread -lz  
/usr/lib/x86\_64-linux-gnu/libcfitsio.a(cfileio.o): In function `ffihtps': (.text+0xbe9a): undefined reference to`curl\_global\_init’  
/usr/lib/x86\_64-linux-gnu/libcfitsio.a(cfileio.o): In function `ffchtps': (.text+0xbeb5): undefined reference to`curl\_global\_cleanup’  
/usr/lib/x86\_64-linux-gnu/libcfitsio.a(drvrmem.o): In function `bzip2uncompress2mem': (.text+0x1262): undefined reference to`BZ2\_bzReadOpen’  
(.text+0x1289): undefined reference to `BZ2_bzRead' (.text+0x12c0): undefined reference to`BZ2\_bzReadClose’  
(.text+0x131e): undefined reference to `BZ2_bzReadClose' (.text+0x1397): undefined reference to`BZ2\_bzReadClose’  
(.text+0x13f7): undefined reference to `BZ2_bzReadClose' /usr/lib/x86_64-linux-gnu/libcfitsio.a(drvrnet.o): In function`https\_open\_network’:  
(.text+0x761): undefined reference to `curl_easy_init' (.text+0x778): undefined reference to`curl\_easy\_setopt’  
(.text+0x7a1): undefined reference to `curl_easy_setopt' (.text+0x7b7): undefined reference to`curl\_easy\_setopt’  
(.text+0x7cd): undefined reference to `curl_easy_setopt' (.text+0x810): undefined reference to`curl\_easy\_setopt’  
/usr/lib/x86\_64-linux-gnu/libcfitsio.a(drvrnet.o):(.text+0x833): more undefined references to `curl_easy_setopt' follow /usr/lib/x86_64-linux-gnu/libcfitsio.a(drvrnet.o): In function`https\_open\_network’:  
(.text+0x8df): undefined reference to `curl_easy_perform' (.text+0x905): undefined reference to`curl\_easy\_cleanup’  
(.text+0x93c): undefined reference to `curl_easy_setopt' (.text+0x94d): undefined reference to`curl\_easy\_setopt’  
(.text+0x955): undefined reference to `curl_easy_perform' (.text+0x9b5): undefined reference to`curl\_easy\_setopt’  
(.text+0x9bd): undefined reference to `curl_easy_perform' (.text+0xa63): undefined reference to`curl\_easy\_cleanup’  
(.text+0xb07): undefined reference to `curl_easy_setopt' (.text+0xb0f): undefined reference to`curl\_easy\_perform’  
collect2: error: ld returned 1 exit status  
/home/manuel/root/graf2d/fitsio/Module.mk:45: recipe for target ‘lib/libFITSIO.so’ failed  
make: \*\*\* [lib/libFITSIO.so] Error 1

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [October 17, 2018, 8:35am UTC](https://root-forum.cern.ch/t/compile-error-on-ubuntu-18-04/31136/2 "2018-10-17T08:35:07Z")

</div>

may be @amadio has an idea about it.

---

<div class="post-metadata">

**Author:** ![amadio](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/amadio/32/12562_2.png) [@amadio](https://root-forum.cern.ch/u/amadio)\
**Post date:** [October 17, 2018, 9:44am UTC](https://root-forum.cern.ch/t/compile-error-on-ubuntu-18-04/31136/3 "2018-10-17T09:44:32Z")

</div>

That doesn’t look like a problem in ROOT, but a problem in the static version of the cfitsio library on your system. Notice that all missing symbols come from it. Try adding `libcurl` to the linking step of libFITSIO.so in ROOT and it may work. Alternatively, try to use the shared version of `libcfitsio` from your system.

---

<div class="post-metadata">

**Author:** ![afiqaize](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/afiqaize/32/14407_2.png) [@afiqaize](https://root-forum.cern.ch/u/afiqaize)\
**Post date:** [October 23, 2018, 10:48am UTC](https://root-forum.cern.ch/t/compile-error-on-ubuntu-18-04/31136/4 "2018-10-23T10:48:09Z")

</div>

Had similar problem recently and I just went with 5.34/38 instead which worked fine in 18.04.

---

<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:** [November 1, 2018, 10:53am UTC](https://root-forum.cern.ch/t/compile-error-on-ubuntu-18-04/31136/5 "2018-11-01T10:53:57Z")

</div>

This has been reported as [https://sft.its.cern.ch/jira/browse/ROOT-9755](https://sft.its.cern.ch/jira/browse/ROOT-9755)

@mp2u this thread is relevant - do you have objections against me moving it into the ROOT section?

---

<div class="post-metadata">

**Author:** ![Bharti\_Kindra](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/4491bb/32.png) [@Bharti\_Kindra](https://root-forum.cern.ch/u/Bharti_Kindra)\
**Post date:** [November 29, 2018, 12:40pm UTC](https://root-forum.cern.ch/t/compile-error-on-ubuntu-18-04/31136/6 "2018-11-29T12:40:04Z")

</div>

Hi. I am facing the similar problem as posted. I am using root version 5.34 on Ubuntu 18.04. I do not know how to implement the solution you suggested. Can you please elaborate the steps?

---

<div class="post-metadata">

**Author:** ![Bharti\_Kindra](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/4491bb/32.png) [@Bharti\_Kindra](https://root-forum.cern.ch/u/Bharti_Kindra)\
**Post date:** [November 29, 2018, 12:54pm UTC](https://root-forum.cern.ch/t/compile-error-on-ubuntu-18-04/31136/7 "2018-11-29T12:54:42Z")

</div>

I tried solution given on [https://sft.its.cern.ch/jira/browse/ROOT-9755](https://sft.its.cern.ch/jira/browse/ROOT-9755) following the reply by @Axel . But I am still getting the same error. But there might be an error in the way I am implementing the solution. In the CMakeLists.txt file, it was written:

ROOT\_LINKER\_LIBRARY(FITSIO \*.cxx G\_\_FITSIO.cxx LIBRARIES ${CFITSIO\_LIBRARIES} DEPENDENCIES Hist Gpad Graf Matrix)

I tried two things:

1. removed " DEPENDENCIES Hist Gpad Graf Matrix)" and wrote “curl”
2. Added “curl” through comma  
ROOT\_LINKER\_LIBRARY(FITSIO \*.cxx G\_\_FITSIO.cxx LIBRARIES ${CFITSIO\_LIBRARIES} DEPENDENCIES Hist Gpad Graf Matrix, curl)

None of these options resolve the errors. Please tell me what is the correct way of doing it.

---

<div class="post-metadata">

**Author:** ![Ebhelixes\_Valencia\_m](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/e/43a26b/32.png) [@Ebhelixes\_Valencia\_m](https://root-forum.cern.ch/u/Ebhelixes_Valencia_m)\
**Post date:** [February 13, 2019, 1:29am UTC](https://root-forum.cern.ch/t/compile-error-on-ubuntu-18-04/31136/8 "2019-02-13T01:29:32Z")

</div>

Hi, I had the same problem and it was solved by using “cmake” instead of “./configure” and “make”. Thus after unpacking the .tar file and move it to your desired directory:

- mkdir root-version\_build
- cd root-version\_build
- cmake …/root-version/
- cmake --build . – -j3
- . bin/thisroot.sh
- root

You can check the useful info here:

[Cannot complie ROOT on ubuntu 18.04](https://root-forum.cern.ch/t/cannot-complie-root-on-ubuntu-18-04/31521/2?u=ebhelixes_valencia_m)

---

<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:** [July 9, 2019, 8:33am UTC](https://root-forum.cern.ch/t/compile-error-on-ubuntu-18-04/31136/9 "2019-07-09T08:33:58Z")

</div>

Closed on July 9, 2019, 8:33am UTC


