# Error while compiling a Go4(ROOT dependent) project

**URL:** <https://root-forum.cern.ch/t/error-while-compiling-a-go4-root-dependent-project/57863>\
**Category:** Newbie\
**Tags:** root\
**Created:** [January 16, 2024, 4:23pm UTC](https://root-forum.cern.ch/t/error-while-compiling-a-go4-root-dependent-project/57863 "2024-01-16T16:23:50Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![utkarsh-2000](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/u/e47774/32.png) [@utkarsh-2000](https://root-forum.cern.ch/u/utkarsh-2000)\
**Post date:** [January 16, 2024, 4:23pm UTC](https://root-forum.cern.ch/t/error-while-compiling-a-go4-root-dependent-project/57863/1 "2024-01-16T16:23:50Z")

</div>

\_ROOT Version:6.28/06  
\_Platform:Ubuntu 22.04  
\_Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0

Hi everyone,

I am unsure if this is the right place to request help.  
But I was trying to compile a[Go4](https://www.gsi.de/en/work/research/experiment_electronics/data_processing/data_analysis/the_go4_home_page/packages) project which is dependent on ROOT, basically to convert list mode files to root files.

However iI am getting the following warnings and errors

```auto
~/root_v6.26/install/include/RConfigure.h:30:4: warning: #warning "The C++ standard in this build does not match ROOT configuration (201703L); this might cause unexpected issues" [-Wcpp]

```

```auto
~/root_v6.26/install/include/ROOT/RConfig.hxx:48:4: error: #error "ROOT requires support for C++14 or higher."
   48 | # error "ROOT requires support for C++14 or higher."
      | ^ ~~~~
~root_v6.26/install/include/ROOT/RConfig.hxx:50:5: error: #error "Pass `-std=c++14` as compiler argument."
   50 | # error "Pass `-std=c++14` as compiler argument."

```

Can someone help me pin down the cause of the error and help in its resolution? Please let me know for any further details. Thank YOu

---

<div class="post-metadata">

**Author:** ![linev](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/2bfe46/32.png) [@linev](https://root-forum.cern.ch/u/linev)\
**Post date:** [January 16, 2024, 4:57pm UTC](https://root-forum.cern.ch/t/error-while-compiling-a-go4-root-dependent-project/57863/2 "2024-01-16T16:57:45Z")

</div>

Hi,

You are trying to compile ROOT 6.28/06, but in your log one sees `~/root_v6.26/install/` directory.

Do you have other ROOT versions installed?  
If yes, can you ensure that none of shell variables like PATH, LD\_LIBRARY\_PATH, ROOTSYS pointing on this other ROOT version.

And if you have older ROOT (like 6.26), it should be sufficient for recent Go4 versions.  
Only for Windows and Mac one need latest Go4 with very recent ROOT - because of web graphics.

Regards,  
Sergey

---

<div class="post-metadata">

**Author:** ![utkarsh-2000](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/u/e47774/32.png) [@utkarsh-2000](https://root-forum.cern.ch/u/utkarsh-2000)\
**Post date:** [January 16, 2024, 5:48pm UTC](https://root-forum.cern.ch/t/error-while-compiling-a-go4-root-dependent-project/57863/3 "2024-01-16T17:48:39Z")

</div>

Hi Sergey,  
emphasized text  
Thanks a lot for your reply.

The directory v6.26 is a result of a lousy convention from my side. Actually, I used `git clone` to install latest stable version of ROOT. Sorry for the confusion.

> [@linev](#):
>
> Do you have other ROOT versions installed?

I am using single root version 6.28.

Please let me know for further queries. Thanks a lot

---

<div class="post-metadata">

**Author:** ![linev](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/2bfe46/32.png) [@linev](https://root-forum.cern.ch/u/linev)\
**Post date:** [January 16, 2024, 5:59pm UTC](https://root-forum.cern.ch/t/error-while-compiling-a-go4-root-dependent-project/57863/4 "2024-01-16T17:59:28Z")

</div>

Hi,

How you compile ROOT? Which cmake arguments are you using?  
For 6.28 it should be like:

```auto
cmake -DCMAKE_CXX_STANDARD=17 -Droot7=ON -Dwebgui=ON -Dxrootd=OFF <path_to_sources>

```

---

<div class="post-metadata">

**Author:** ![utkarsh-2000](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/u/e47774/32.png) [@utkarsh-2000](https://root-forum.cern.ch/u/utkarsh-2000)\
**Post date:** [January 16, 2024, 6:04pm UTC](https://root-forum.cern.ch/t/error-while-compiling-a-go4-root-dependent-project/57863/5 "2024-01-16T18:04:43Z")

</div>

HI thanks,

> [@linev](#):
>
> How you compile ROOT? Which cmake arguments are you using?

I used all the default cmake arguments except for the custom install prefix.  
Thanks a lot for sharing the arguments I will give them a try and see if it works.

Just a very silly question: for `-DCMAKE_CXX_STANDARD=17`, does gcc version need to be 17 as well? I currently have 11.2.

---

<div class="post-metadata">

**Author:** ![linev](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/2bfe46/32.png) [@linev](https://root-forum.cern.ch/u/linev)\
**Post date:** [January 16, 2024, 6:06pm UTC](https://root-forum.cern.ch/t/error-while-compiling-a-go4-root-dependent-project/57863/6 "2024-01-16T18:06:22Z")

</div>

gcc 11.2 is good enough for c++17.  
You can use ROOT build directory for Go4 compilation and running.

---

<div class="post-metadata">

**Author:** ![utkarsh-2000](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/u/e47774/32.png) [@utkarsh-2000](https://root-forum.cern.ch/u/utkarsh-2000)\
**Post date:** [January 16, 2024, 6:09pm UTC](https://root-forum.cern.ch/t/error-while-compiling-a-go4-root-dependent-project/57863/7 "2024-01-16T18:09:51Z")

</div>

> [@linev](#):
>
> gcc 11.2 is good enough for c++17.

Thanks for the confirmation.

> [@linev](#):
>
> You can use ROOT build directory for Go4 compilation and running.

So, to summarize, I need to run CMake again with the above argument and then make in ROOT build directory followed by Go4 compilation, please correct me if I am wrong,

Thanks a lot for your help

---

<div class="post-metadata">

**Author:** ![linev](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/2bfe46/32.png) [@linev](https://root-forum.cern.ch/u/linev)\
**Post date:** [January 16, 2024, 6:11pm UTC](https://root-forum.cern.ch/t/error-while-compiling-a-go4-root-dependent-project/57863/8 "2024-01-16T18:11:13Z")

</div>

Yes, correct

---

<div class="post-metadata">

**Author:** ![utkarsh-2000](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/u/e47774/32.png) [@utkarsh-2000](https://root-forum.cern.ch/u/utkarsh-2000)\
**Post date:** [January 16, 2024, 6:17pm UTC](https://root-forum.cern.ch/t/error-while-compiling-a-go4-root-dependent-project/57863/9 "2024-01-16T18:17:09Z")

</div>

Thank You. I will try following that.

On a totally different note, I just tried running Go4 on a different machine.  
Root 6.24 and gcc 9.4. I was able to compile Go4, but when compiling an analysis code, I get a different error,

```auto
Generating root6 dictionary G__SCN.cxx ...
Warning in cling::IncrementalParser::CheckABICompatibility():
  Possible C++ standard library mismatch, compiled with __GLIBCXX__'20200808'
  Extraction of runtime standard library version was: '20210601'
g++ -c EventUnpackStore.cxx -O2 -fPIC -Wall -DLinux -pthread -std=c++14 -m64 -I/home/utkarsh/root_v6.24.04/root/include -I/home/utkarsh/go4/build/include -I/home/utkarsh/go4/build -std=c++11 -fdiagnostics-color -g -Wno-unused-variable -Wno-unused-but-set-variable -o EventUnpackStore.o 
In file included from /home/utkarsh/root_v6.24.04/root/include/TString.h:29,
                 from /home/utkarsh/root_v6.24.04/root/include/TNamed.h:26,
                 from /home/utkarsh/go4/build/include/TGo4EventElement.h:17,
                 from AIDA_Decay_Event_Store.h:4,
                 from Raw_Event.h:13,
                 from AIDA_Event.h:5,
                 from EventUnpackStore.h:20,
                 from EventUnpackStore.cxx:16:
/home/utkarsh/root_v6.24.04/root/include/ROOT/RStringView.hxx:32:37: error: ‘experimental’ in namespace ‘std’ does not name a type
   32 | using basic_string_view = ::std::experimental::basic_string_view<_CharT,_Traits>;
      | ^ ~~~~~~~~~~~
/home/utkarsh/root_v6.24.04/root/include/ROOT/RStringView.hxx:35:12: error: ‘basic_string_view’ does not name a type
   35 | typedef basic_string_view<char> string_view;
      | ^ ~~~~~~~~~~~~~~~~
/home/utkarsh/root_v6.24.04/root/include/ROOT/RStringView.hxx:36:12: error: ‘basic_string_view’ does not name a type
   36 | typedef basic_string_view<char16_t> u16string_view;
      | ^ ~~~~~~~~~~~~~~~~
/home/utkarsh/root_v6.24.04/root/include/ROOT/RStringView.hxx:37:12: error: ‘basic_string_view’ does not name a type
   37 | typedef basic_string_view<char32_t> u32string_view;
      | ^ ~~~~~~~~~~~~~~~~
/home/utkarsh/root_v6.24.04/root/include/ROOT/RStringView.hxx:38:12: error: ‘basic_string_view’ does not name a type
   38 | typedef basic_string_view<wchar_t> wstring_view;
      | ^ ~~~~~~~~~~~~~~~~
/home/utkarsh/root_v6.24.04/root/include/ROOT/RStringView.hxx:48:4: warning: inline variables are only available with ‘-std=c++17’ or ‘-std=gnu++17’
   48 | inline double stod(std::string_view str, size_t *pos)
      | ^ ~~~~~
/home/utkarsh/root_v6.24.04/root/include/ROOT/RStringView.hxx:48:28: error: ‘string_view’ is not a member of ‘std’
   48 | inline double stod(std::string_view str, size_t *pos)
      | ^ ~~~~~~~~~~
/home/utkarsh/root_v6.24.04/root/include/ROOT/RStringView.hxx:48:28: note: ‘std::string_view’ is only available from C++17 onwards
/home/utkarsh/root_v6.24.04/root/include/ROOT/RStringView.hxx:48:52: error: expected primary-expression before ‘*’ token
   48 | inline double stod(std::string_view str, size_t *pos)
      | ^
/home/utkarsh/root_v6.24.04/root/include/ROOT/RStringView.hxx:48:53: error: ‘pos’ was not declared in this scope; did you mean ‘ios’?
   48 | inline double stod(std::string_view str, size_t *pos)
      | ^~~
      | ios
/home/utkarsh/root_v6.24.04/root/include/ROOT/RStringView.hxx:48:56: error: expression list treated as compound expression in initializer [-fpermissive]
   48 | inline double stod(std::string_view str, size_t *pos)
      | ^
/home/utkarsh/root_v6.24.04/root/include/ROOT/RStringView.hxx:65:56: error: ‘std::string_view’ has not been declared
   65 | inline std::string &operator+=(std::string &left, std::string_view right)
      | ^ ~~~~~~~~~~
/home/utkarsh/root_v6.24.04/root/include/ROOT/RStringView.hxx: In function ‘std::string& std::__ROOT::operator+=(std::string&, int)’:
/home/utkarsh/root_v6.24.04/root/include/ROOT/RStringView.hxx:67:29: error: request for member ‘data’ in ‘right’, which is of non-class type ‘int’
   67 | return left.append(right.data(), right.size());
      | ^~~~
/home/utkarsh/root_v6.24.04/root/include/ROOT/RStringView.hxx:67:43: error: request for member ‘size’ in ‘right’, which is of non-class type ‘int’
   67 | return left.append(right.data(), right.size());
      | ^~~~
/home/utkarsh/root_v6.24.04/root/include/ROOT/RStringView.hxx: At global scope:
/home/utkarsh/root_v6.24.04/root/include/ROOT/RStringView.hxx:84:17: error: expected type-specifier
   84 | operator std::string_view() const { return std::string_view(fData,fLength); }
      | ^~~
In file included from /home/utkarsh/root_v6.24.04/root/include/TNamed.h:26,
                 from /home/utkarsh/go4/build/include/TGo4EventElement.h:17,
                 from AIDA_Decay_Event_Store.h:4,
                 from Raw_Event.h:13,
                 from AIDA_Event.h:5,
                 from EventUnpackStore.h:20,
                 from EventUnpackStore.cxx:16:
/home/utkarsh/root_v6.24.04/root/include/TString.h:115:13: error: expected type-specifier
  115 | operator std::string_view() const { return std::string_view(Data(),fExtent); }
      | ^~~
/home/utkarsh/root_v6.24.04/root/include/TString.h:280:32: error: ‘string_view’ in namespace ‘std’ does not name a type
  280 | explicit TString(const std::string_view &sub);
      | ^ ~~~~~~~~~~
/home/utkarsh/root_v6.24.04/root/include/TString.h:280:27: note: ‘std::string_view’ is only available from C++17 onwards
  280 | explicit TString(const std::string_view &sub);
      | ^~~
/home/utkarsh/root_v6.24.04/root/include/TString.h:317:37: error: ‘string_view’ in namespace ‘std’ does not name a type
  317 | TString &operator=(const std::string_view &s);
      | ^ ~~~~~~~~~~
/home/utkarsh/root_v6.24.04/root/include/TString.h:317:32: note: ‘std::string_view’ is only available from C++17 onwards
  317 | TString &operator=(const std::string_view &s);
      | ^~~
/home/utkarsh/root_v6.24.04/root/include/TString.h:444:9: error: ‘string_view’ in namespace ‘std’ does not name a type
  444 | std::string_view View() const { return std::string_view(GetPointer(),Length()); }
      | ^ ~~~~~~~~~~
/home/utkarsh/root_v6.24.04/root/include/TString.h:444:4: note: ‘std::string_view’ is only available from C++17 onwards
  444 | std::string_view View() const { return std::string_view(GetPointer(),Length()); }
      | ^~~
In file included from /home/utkarsh/root_v6.24.04/root/include/TNamed.h:26,
                 from /home/utkarsh/go4/build/include/TGo4EventElement.h:17,
                 from AIDA_Decay_Event_Store.h:4,
                 from Raw_Event.h:13,
                 from AIDA_Event.h:5,
                 from EventUnpackStore.h:20,
                 from EventUnpackStore.cxx:16:
/home/utkarsh/root_v6.24.04/root/include/TString.h:839:53: error: ‘string_view’ in namespace ‘std’ does not name a type
  839 | inline Bool_t operator==(const char *s1, const std::string_view &s2)
      | ^ ~~~~~~~~~~
/home/utkarsh/root_v6.24.04/root/include/TString.h:839:48: note: ‘std::string_view’ is only available from C++17 onwards
  839 | inline Bool_t operator==(const char *s1, const std::string_view &s2)
      | ^~~
/home/utkarsh/root_v6.24.04/root/include/TString.h:839:15: error: ‘Bool_t operator==(const char*, const int&)’ must have an argument of class or enumerated type
  839 | inline Bool_t operator==(const char *s1, const std::string_view &s2)
      | ^ ~~~~~~~
/home/utkarsh/root_v6.24.04/root/include/TString.h:844:37: error: ‘string_view’ in namespace ‘std’ does not name a type
  844 | inline Bool_t operator==(const std::string_view &s1, const char *s2)
      | ^ ~~~~~~~~~~
/home/utkarsh/root_v6.24.04/root/include/TString.h:844:32: note: ‘std::string_view’ is only available from C++17 onwards
  844 | inline Bool_t operator==(const std::string_view &s1, const char *s2)
      | ^~~
/home/utkarsh/root_v6.24.04/root/include/TString.h:844:15: error: ‘Bool_t operator==(const int&, const char*)’ must have an argument of class or enumerated type
  844 | inline Bool_t operator==(const std::string_view &s1, const char *s2)
      | ^ ~~~~~~~
/home/utkarsh/root_v6.24.04/root/include/TString.h:857:37: error: ‘string_view’ in namespace ‘std’ does not name a type
  857 | std::string printValue(const std::string_view* val);
      | ^ ~~~~~~~~~~
/home/utkarsh/root_v6.24.04/root/include/TString.h:857:32: note: ‘std::string_view’ is only available from C++17 onwards
  857 | std::string printValue(const std::string_view* val);
      | ^~~
make: *** [/home/utkarsh/go4/build/Makefile.rules:50: EventUnpackStore.o] Error 1
utkarsh@utkarsh-Inspiron-14-5408:~/Documents/ms theisis project/Thorium_SINP_GSI/SonOfOdin2021_despec

```

Can you please share your inputs here as to what is going wrong, thanks a lot.

---

<div class="post-metadata">

**Author:** ![linev](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/2bfe46/32.png) [@linev](https://root-forum.cern.ch/u/linev)\
**Post date:** [January 16, 2024, 6:54pm UTC](https://root-forum.cern.ch/t/error-while-compiling-a-go4-root-dependent-project/57863/10 "2024-01-16T18:54:25Z")

</div>

> [@utkarsh-2000](#):
>
> ```auto
> Warning in cling::IncrementalParser::CheckABICompatibility():
> Possible C++ standard library mismatch, compiled with __GLIBCXX__'20200808'
> Extraction of runtime standard library version was: '20210601'
> 
> ```

This is indication that you have different ROOT version installed on the system.  
Please check and remove it.

---

<div class="post-metadata">

**Author:** ![utkarsh-2000](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/u/e47774/32.png) [@utkarsh-2000](https://root-forum.cern.ch/u/utkarsh-2000)\
**Post date:** [January 16, 2024, 7:07pm UTC](https://root-forum.cern.ch/t/error-while-compiling-a-go4-root-dependent-project/57863/11 "2024-01-16T19:07:38Z")

</div>

> [@linev](#):
>
> This is indication that you have different ROOT version installed on the system.  
> Please check and remove it.

Okay, thanks for your reply, actually this is from a different computer. I will, however check and remove it.

---

<div class="post-metadata">

**Author:** ![utkarsh-2000](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/u/e47774/32.png) [@utkarsh-2000](https://root-forum.cern.ch/u/utkarsh-2000)\
**Post date:** [January 17, 2024, 10:20am UTC](https://root-forum.cern.ch/t/error-while-compiling-a-go4-root-dependent-project/57863/12 "2024-01-17T10:20:00Z")

</div>

Hi @linev ,  
I compiled root using the c++ 17 argument as confirmed by

```auto
-pthread -std=c++17 -m64 -I/home/frena_storage/akashrup/root_v6.26/install/include

```

However, I am still seeing the same issue when compiling the project.

I suspect the Go4 is built using a different compiler standard. Is there a way to check this for Go4?

Thanks a lot !

---

<div class="post-metadata">

**Author:** ![linev](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/2bfe46/32.png) [@linev](https://root-forum.cern.ch/u/linev)\
**Post date:** [January 17, 2024, 1:22pm UTC](https://root-forum.cern.ch/t/error-while-compiling-a-go4-root-dependent-project/57863/13 "2024-01-17T13:22:57Z")

</div>

Hi,

go4 always reuse compiler flags from ROOT.  
In your case you see warnings coming from ROOT dictionary generation and  
it indicates that ROOT binaries build with other glibc.

Most probably, you have older ROOT installed in default locations like /usr/bin and /usr/lib64

Can you start new shell and call: `which root-config` if any ROOT installation is around.

---

<div class="post-metadata">

**Author:** ![utkarsh-2000](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/u/e47774/32.png) [@utkarsh-2000](https://root-forum.cern.ch/u/utkarsh-2000)\
**Post date:** [January 17, 2024, 1:33pm UTC](https://root-forum.cern.ch/t/error-while-compiling-a-go4-root-dependent-project/57863/14 "2024-01-17T13:33:01Z")

</div>

Hi these are the commands.

```auto
which root-config
>>>~/root_v6.26/install/bin/root-config

```

```auto
echo $ROOTSYS
>>>~/root_v6.26/install

```

---

<div class="post-metadata">

**Author:** ![linev](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/2bfe46/32.png) [@linev](https://root-forum.cern.ch/u/linev)\
**Post date:** [January 17, 2024, 1:35pm UTC](https://root-forum.cern.ch/t/error-while-compiling-a-go4-root-dependent-project/57863/15 "2024-01-17T13:35:08Z")

</div>

Means you have this version in the paths - which make it very difficult to compile go4 with any other ROOT version.

---

<div class="post-metadata">

**Author:** ![utkarsh-2000](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/u/e47774/32.png) [@utkarsh-2000](https://root-forum.cern.ch/u/utkarsh-2000)\
**Post date:** [January 17, 2024, 1:37pm UTC](https://root-forum.cern.ch/t/error-while-compiling-a-go4-root-dependent-project/57863/16 "2024-01-17T13:37:18Z")

</div>

Just one more input I can run and compile all the examples provided by Go4 and see the test.lmd as root.

The makefile of the analysis project has a line

```auto
CXXFLAGS += -std=c++11 -fdiagnostics-color -g -Wno-unused-variable -Wno-unused-but-set-variable

```

Can this lead to issue ?

Thanks a lot for all your help and assiatnec

---

<div class="post-metadata">

**Author:** ![linev](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/2bfe46/32.png) [@linev](https://root-forum.cern.ch/u/linev)\
**Post date:** [January 17, 2024, 1:39pm UTC](https://root-forum.cern.ch/t/error-while-compiling-a-go4-root-dependent-project/57863/17 "2024-01-17T13:39:17Z")

</div>

Yes, you try to redefine c++ standard.

Please remove `-std=c++11` from the makefile. Also `-g` required only for debugging.

---

<div class="post-metadata">

**Author:** ![utkarsh-2000](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/u/e47774/32.png) [@utkarsh-2000](https://root-forum.cern.ch/u/utkarsh-2000)\
**Post date:** [January 17, 2024, 1:40pm UTC](https://root-forum.cern.ch/t/error-while-compiling-a-go4-root-dependent-project/57863/18 "2024-01-17T13:40:05Z")

</div>

Ok Thanks for your input Ill try that and share
