# Problems compiling root with gcc 9.1

**URL:** <https://root-forum.cern.ch/t/problems-compiling-root-with-gcc-9-1/34423>\
**Category:** ROOT\
**Created:** [June 4, 2019, 7:56pm UTC](https://root-forum.cern.ch/t/problems-compiling-root-with-gcc-9-1/34423 "2019-06-04T19:56:03Z")\
**Posts on this page:** 1\
**Showing post:** 15

<div class="post-metadata">

**Author:** ![vaubee](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/v/ecb155/32.png) [@vaubee](https://root-forum.cern.ch/u/vaubee)\
**Post date:** [June 12, 2019, 12:48pm UTC](https://root-forum.cern.ch/t/problems-compiling-root-with-gcc-9-1/34423/15 "2019-06-12T12:48:37Z")

</div>

The -Dbuiltin\_xrootd=ON flag works for the master branch. I tried using the same flag for the previous versions (6.14.04, 6.14.06, and 6.16.00) and got the error:

```auto
[I] No git repository info found. Trying to interpret VERSION_INFO
[I] src/XrdVersion.hh successfully generated
/opt/cern/root/root_v6.16.00-gcc9/XROOTD-prefix/src/XROOTD/src/XrdXrootd/XrdXrootdProtocol.cc: In member function 'XrdXrootdProtocol XrdXrootdProtocol::operator=(const XrdXrootdProtocol&)':
/opt/cern/root/root_v6.16.00-gcc9/XROOTD-prefix/src/XROOTD/src/XrdXrootd/XrdXrootdProtocol.cc:234:12: error: implicitly-declared 'XrdXrootdProtocol::XrdXrootdProtocol(XrdXrootdProtocol&)' is deprecated [-Werror=deprecated-copy]
  234 | return *this;
      | ^~~~
/opt/cern/root/root_v6.16.00-gcc9/XROOTD-prefix/src/XROOTD/src/XrdXrootd/XrdXrootdProtocol.cc:215:19: note: because 'XrdXrootdProtocol' has user-provided 'XrdXrootdProtocol XrdXrootdProtocol::operator=(const XrdXrootdProtocol&)'
  215 | XrdXrootdProtocol XrdXrootdProtocol::operator =(const XrdXrootdProtocol &rhs)
      | ^ ~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make[5]: *** [src/CMakeFiles/XrdServer.dir/XrdXrootd/XrdXrootdProtocol.cc.o] Error 1
make[4]: *** [src/CMakeFiles/XrdServer.dir/all] Error 2
make[4]: *** Waiting for unfinished jobs....
make[3]: *** [all] Error 2

```

So I tried using the -Dxrootd=OFF flag instead, and this works for all three versions.

So to recap, compiling on CentOS 6 with a custom gcc 9.1 requires the use of `-Dsqlite=OFF` as well as `-Dxrootd=OFF` for all older versions and `-Dbuiltin_xrootd=ON` for the newest version.

---

_[View the full topic](https://root-forum.cern.ch/t/problems-compiling-root-with-gcc-9-1/34423)._
