# 'collect2: error: ld returned 1 exit status' message when I try to build root with -j4

**URL:** <https://root-forum.cern.ch/t/collect2-error-ld-returned-1-exit-status-message-when-i-try-to-build-root-with-j4/43714>\
**Category:** ROOT\
**Tags:** build\
**Created:** [February 26, 2021, 1:36am UTC](https://root-forum.cern.ch/t/collect2-error-ld-returned-1-exit-status-message-when-i-try-to-build-root-with-j4/43714 "2021-02-26T01:36:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fer-tofe](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/fer-tofe/32/25110_2.png) [@fer-tofe](https://root-forum.cern.ch/u/fer-tofe)\
**Post date:** [February 26, 2021, 1:36am UTC](https://root-forum.cern.ch/t/collect2-error-ld-returned-1-exit-status-message-when-i-try-to-build-root-with-j4/43714/1 "2021-02-26T01:36:41Z")

</div>

\_ROOT Version: 6.22.06  
\_Platform: Ubuntu 20.04.2.0 LTS  
\_Compiler: gcc 9.3.0

* * *

My laptop turned off because of an accident when it was at 74% after ‘make -j 4’ command while I was building ROOT from source. When I initialized my laptop and run ‘make -j 4’ again I got the next error:

> /usr/bin/ld: TTabCom.cxx:(.text.unlikely+0xdd5): referencia a `TString::~TString()' sin definir ... /usr/bin/ld: TTabCom.cxx:(.text.unlikely+0xdd5): referencia a `TString::~TString()’ sin definir  
> /usr/bin/ld: CMakeFiles/Rint.dir/src/TTabCom.cxx.o: en la función `_GLOBAL__sub_I_TTabCom.cxx': TTabCom.cxx:(.text.startup+0x15): referencia a `TVersionCheck::TVersionCheck(int)’ sin definir  
> /usr/bin/ld: TTabCom.cxx:(.text.startup+0x42): referencia a `ROOT::GenerateInitInstance(TTabCom const*)' sin definir /usr/bin/ld: TTabCom.cxx:(.text.startup+0x5a): referencia a `ROOT::TGenericClassInfo::SetImplFile(char const\*, int)’ sin definir  
> /usr/bin/ld: CMakeFiles/Rint.dir/src/TTabCom.cxx.o:(.data.rel.ro.\_ZTV7TTabCom[\_ZTV7TTabCom]+0x38): referencia a `TTabCom::Streamer(TBuffer&)’ sin definir  
> collect2: error: ld returned 1 exit status  
> make[2]: \*\*\* [core/rint/CMakeFiles/Rint.dir/build.make:102: lib/libRint.so] Error 1  
> make[1]: \*\*\* [CMakeFiles/Makefile2:19164: core/rint/CMakeFiles/Rint.dir/all] Error 2  
> make: \*\*\* [Makefile:152: all] Error 2

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [February 26, 2021, 7:13am UTC](https://root-forum.cern.ch/t/collect2-error-ld-returned-1-exit-status-message-when-i-try-to-build-root-with-j4/43714/2 "2021-02-26T07:13:28Z")

</div>

If the build was incomplete, some files might be corrupted, so I would just delete the files causing an error and start again (otherwise just re-start from scratch)

---

<div class="post-metadata">

**Author:** ![eguiraud](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/eguiraud/32/32217_2.png) [@eguiraud](https://root-forum.cern.ch/u/eguiraud)\
**Post date:** [February 26, 2021, 8:36am UTC](https://root-forum.cern.ch/t/collect2-error-ld-returned-1-exit-status-message-when-i-try-to-build-root-with-j4/43714/3 "2021-02-26T08:36:03Z")

</div>

Hi @fer-tofe ,  
slightly off-topic but in case it helps: note that unless you have very specific needs you don’t need to compile ROOT from scratch, you can install a pre-compiled binary, or install ROOT via conda or snap (in particular on Ubuntu snap is really easy to use, see [this blog post](https://root.cern/blog/snap-announcement/)). See [https://root.cern/install](https://root.cern/install) for an overview of different installation methods.

Cheers,  
Enrico

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [March 12, 2021, 8:36am UTC](https://root-forum.cern.ch/t/collect2-error-ld-returned-1-exit-status-message-when-i-try-to-build-root-with-j4/43714/4 "2021-03-12T08:36:26Z")

</div>

Closed on March 12, 2021, 8:36am UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
