# Problem in installation

**URL:** <https://root-forum.cern.ch/t/problem-in-installation/45918>\
**Category:** Garfield++\
**Created:** [July 20, 2021, 2:55am UTC](https://root-forum.cern.ch/t/problem-in-installation/45918 "2021-07-20T02:55:50Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![lyp](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/ecc23a/32.png) [@lyp](https://root-forum.cern.ch/u/lyp)\
**Post date:** [July 20, 2021, 2:55am UTC](https://root-forum.cern.ch/t/problem-in-installation/45918/1 "2021-07-20T02:55:50Z")

</div>

I have downloaded a garfield-master version ,and then cmake successfully. But when i use ‘make -j8’ ,it feedback error as follow

 ![2021-07-20 10-50-24 的屏幕截图](https://root-forum.cern.ch/uploads/default/original/3X/5/a/5a329007fef9cb418715a2f66ee40f61c4ae04ff.png)

Then i skip this step ,however i couldn’t find install folder in next step. How could i deal with these problem

 ![2021-07-20 10-54-37 的屏幕截图](https://root-forum.cern.ch/uploads/default/original/3X/8/0/8009744496b2bf2089975cefccca9231873ac6e6.png)

I am very appreciated if you could give me some advices.

---

<div class="post-metadata">

**Author:** ![hschindl](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/977dab/32.png) [@hschindl](https://root-forum.cern.ch/u/hschindl)\
**Post date:** [July 21, 2021, 7:49am UTC](https://root-forum.cern.ch/t/problem-in-installation/45918/2 "2021-07-21T07:49:28Z")

</div>

I’m not sure because I can’t read the error message, but the reason could be that CMake found a Geant4 installation without the “advanced option” to include GDML. You could either

- update your Geant4 installation to include GDML, or
- if you don’t plan to use the Garfield++/Geant4 interface, re-run CMake with the option  
`-DWITH_EXAMPLES=OFF`

Maybe @caiazza can also help…

---

<div class="post-metadata">

**Author:** ![caiazza](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/caiazza/32/13962_2.png) [@caiazza](https://root-forum.cern.ch/u/caiazza)\
**Post date:** [July 21, 2021, 10:14am UTC](https://root-forum.cern.ch/t/problem-in-installation/45918/3 "2021-07-21T10:14:01Z")

</div>

If make didn’t complete is normal that you didn’t find the install folder, as that will be only created and filled in the last stage of the build process.  
Unfortunately without the full log of the build process and the state of the CMake cache is difficult to understand what is exactly going on.  
Could you please write the console output of the make command to a txt file that you can attach to this request?

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [July 21, 2021, 10:29am UTC](https://root-forum.cern.ch/t/problem-in-installation/45918/4 "2021-07-21T10:29:51Z")

</div>

The line complaining about the “`std::string_view`” being available only “from `C++17` onwards” suggests that there is a mismatch in the C++ language standard used by different libraries (i.e. Geant4 and / or Garfield++ and / or ROOT).

---

<div class="post-metadata">

**Author:** ![lyp](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/ecc23a/32.png) [@lyp](https://root-forum.cern.ch/u/lyp)\
**Post date:** [July 22, 2021, 1:10am UTC](https://root-forum.cern.ch/t/problem-in-installation/45918/5 "2021-07-22T01:10:57Z")

</div>

I installed geant4 following the instructor on the internet, and i didn’t remember i installed GDML…

Actually, i don’t konw what is gdml, is that a library of geant4?

I researched on geant4 directory and then found a folder called “gdml” under the geant4/source/persistency. It that mean i already have gdml?

 ![2021-07-22 09-03-59 的屏幕截图](https://root-forum.cern.ch/uploads/default/original/3X/9/2/9272eed34f8d47c999d4161fdb9ad61e336cdb0f.png)

Sorry, i am a noob in linux 😵, and thank you for your precious time again.

---

<div class="post-metadata">

**Author:** ![lyp](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/ecc23a/32.png) [@lyp](https://root-forum.cern.ch/u/lyp)\
**Post date:** [July 22, 2021, 1:22am UTC](https://root-forum.cern.ch/t/problem-in-installation/45918/6 "2021-07-22T01:22:26Z")

</div>

I have installed gcc 9.3.0, it is theoretical support c++17…I am not sure whether the problem is form here.

I think posting a entire code may help to resolve this problem effectively, here is the code.  
lyp@lyp-System-Product-Name:~/garfield++/garfieldpp-4.0/build$ make -j8  
[1%] Built target magboltz  
[66%] Built target Garfield  
[69%] Built target generate  
[69%] Built target printTable  
[69%] Built target merge  
[70%] Built target gem  
[71%] Built target penning  
[72%] Built target read  
[73%] Built target mdt  
[74%] Built target mdt\_mt  
[76%] Built target polar  
[76%] Built target gallery  
[77%] Built target strip  
[78%] Built target dipole  
[80%] Built target fieldlines  
[80%] Built target integrate  
[81%] Built target isochrons  
[82%] Built target wedge  
[83%] Built target savefield  
[85%] Built target trim  
[85%] Built target plotdedx  
[86%] Built target edep  
[88%] Built target rangeSi  
[88%] Built target qdepSi  
[89%] Built target plotfield  
[90%] Built target fe55  
[91%] Built target srim  
[91%] Built target parallelPlates  
[92%] Built target MWPCbyneBEM  
[92%] Built target parallelPlatesWeightingField  
[93%] Built target crossingWires  
[93%] Built target BiconicalGemByneBEM  
[94%] Built target RPCbyneBEM  
[95%] Building CXX object Examples/Geant4GarfieldInterface/CMakeFiles/exampleGeant4Interface.dir/exampleGarfield.cc.o  
[96%] Building CXX object Examples/Geant4GarfieldInterface/CMakeFiles/exampleGeant4Interface.dir/src/GarfieldG4FastSimulationModel.cc.o  
[96%] Building CXX object Examples/Geant4GarfieldInterface/CMakeFiles/exampleGeant4Interface.dir/src/GarfieldMessenger.cc.o  
[96%] Building CXX object Examples/Geant4GarfieldInterface/CMakeFiles/exampleGeant4Interface.dir/src/GarfieldPhysics.cc.o  
[97%] Building CXX object Examples/Geant4GarfieldInterface/CMakeFiles/exampleGeant4Interface.dir/src/GarfieldPrimaryGeneratorAction.cc.o  
[97%] Building CXX object Examples/Geant4GarfieldInterface/CMakeFiles/exampleGeant4Interface.dir/src/GarfieldPhysicsList.cc.o  
[97%] Building CXX object Examples/Geant4GarfieldInterface/CMakeFiles/exampleGeant4Interface.dir/src/GarfieldRunAction.cc.o  
[98%] Building CXX object Examples/Geant4GarfieldInterface/CMakeFiles/exampleGeant4Interface.dir/src/GarfieldSteppingAction.cc.o  
/home/lyp/garfield++/garfieldpp-4.0/Examples/Geant4GarfieldInterface/src/GarfieldG4FastSimulationModel.cc:36:10: fatal error: G4GDMLParser.hh: 没有那个文件或目录  
36 | #include “G4GDMLParser.hh”  
| ^ ~~~~~~~~~~~~~~~~  
compilation terminated.  
make[2]: \*\*\* [Examples/Geant4GarfieldInterface/CMakeFiles/exampleGeant4Interface.dir/build.make:102：Examples/Geant4GarfieldInterface/CMakeFiles/exampleGeant4Interface.dir/src/GarfieldG4FastSimulationModel.cc.o] 错误 1  
make[2]: \*\*\* 正在等待未完成的任务…  
In file included from /home/lyp/garfield++/root/include/TString.h:29,  
from /home/lyp/garfield++/root/include/TNamed.h:26,  
from /home/lyp/garfield++/root/include/TRandom.h:25,  
from /home/lyp/garfield++/root/include/TRandom3.h:25,  
from /home/lyp/garfield++/garfieldpp-4.0/Include/Garfield/RandomEngineRoot.hh:4,  
from /home/lyp/garfield++/garfieldpp-4.0/Include/Garfield/Random.hh:6,  
from /home/lyp/garfield++/garfieldpp-4.0/Examples/Geant4GarfieldInterface/exampleGarfield.cc:46:  
/home/lyp/garfield++/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/lyp/garfield++/root/include/ROOT/RStringView.hxx:35:12: error: ‘basic\_string\_view’ does not name a type  
35 | typedef basic\_string\_view string\_view;  
| ^ ~~~~~~~~~~~~~~~~  
/home/lyp/garfield++/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/lyp/garfield++/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/lyp/garfield++/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/lyp/garfield++/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/lyp/garfield++/root/include/ROOT/RStringView.hxx:48:28: note: ‘std::string\_view’ is only available from C++17 onwards  
/home/lyp/garfield++/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/lyp/garfield++/root/include/ROOT/RStringView.hxx:48:53: error: ‘pos’ was not declared in this scope; did you mean ‘pow’?  
48 | inline double stod(std::string\_view str, size\_t pos)  
| ^~~  
| pow  
/home/lyp/garfield++/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/lyp/garfield++/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/lyp/garfield++/root/include/ROOT/RStringView.hxx: In function ‘std::string& std::\_\_ROOT::operator+=(std::string&, int)’:  
/home/lyp/garfield++/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/lyp/garfield++/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/lyp/garfield++/root/include/ROOT/RStringView.hxx: At global scope:  
/home/lyp/garfield++/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/lyp/garfield++/root/include/TNamed.h:26,  
from /home/lyp/garfield++/root/include/TRandom.h:25,  
from /home/lyp/garfield++/root/include/TRandom3.h:25,  
from /home/lyp/garfield++/garfieldpp-4.0/Include/Garfield/RandomEngineRoot.hh:4,  
from /home/lyp/garfield++/garfieldpp-4.0/Include/Garfield/Random.hh:6,  
from /home/lyp/garfield++/garfieldpp-4.0/Examples/Geant4GarfieldInterface/exampleGarfield.cc:46:  
/home/lyp/garfield++/root/include/TString.h:115:13: error: expected type-specifier  
115 | operator std::string\_view() const { return std::string\_view(Data(),fExtent); }  
| ^~~  
/home/lyp/garfield++/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/lyp/garfield++/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/lyp/garfield++/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/lyp/garfield++/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/lyp/garfield++/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/lyp/garfield++/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/lyp/garfield++/root/include/TNamed.h:26,  
from /home/lyp/garfield++/root/include/TRandom.h:25,  
from /home/lyp/garfield++/root/include/TRandom3.h:25,  
from /home/lyp/garfield++/garfieldpp-4.0/Include/Garfield/RandomEngineRoot.hh:4,  
from /home/lyp/garfield++/garfieldpp-4.0/Include/Garfield/Random.hh:6,  
from /home/lyp/garfield++/garfieldpp-4.0/Examples/Geant4GarfieldInterface/exampleGarfield.cc:46:  
/home/lyp/garfield++/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/lyp/garfield++/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/lyp/garfield++/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/lyp/garfield++/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/lyp/garfield++/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/lyp/garfield++/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/lyp/garfield++/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/lyp/garfield++/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[2]: \*\*\* [Examples/Geant4GarfieldInterface/CMakeFiles/exampleGeant4Interface.dir/build.make:63：Examples/Geant4GarfieldInterface/CMakeFiles/exampleGeant4Interface.dir/exampleGarfield.cc.o] 错误 1  
In file included from /home/lyp/garfield++/root/include/TString.h:29,  
from /home/lyp/garfield++/root/include/TCollection.h:29,  
from /home/lyp/garfield++/root/include/TSeqCollection.h:25,  
from /home/lyp/garfield++/root/include/TList.h:25,  
from /home/lyp/garfield++/root/include/TQObject.h:40,  
from /home/lyp/garfield++/root/include/TVirtualPad.h:30,  
from /home/lyp/garfield++/root/include/TPad.h:15,  
from /home/lyp/garfield++/garfieldpp-4.0/Include/Garfield/ViewBase.hh:8,  
from /home/lyp/garfield++/garfieldpp-4.0/Include/Garfield/ViewDrift.hh:12,  
from /home/lyp/garfield++/garfieldpp-4.0/Include/Garfield/AvalancheMC.hh:10,  
from /home/lyp/garfield++/garfieldpp-4.0/Examples/Geant4GarfieldInterface/src/GarfieldPhysics.cc:31:  
/home/lyp/garfield++/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/lyp/garfield++/root/include/ROOT/RStringView.hxx:35:12: error: ‘basic\_string\_view’ does not name a type  
35 | typedef basic\_string\_view string\_view;  
| ^ ~~~~~~~~~~~~~~~~  
/home/lyp/garfield++/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/lyp/garfield++/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/lyp/garfield++/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/lyp/garfield++/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/lyp/garfield++/root/include/ROOT/RStringView.hxx:48:28: note: ‘std::string\_view’ is only available from C++17 onwards  
/home/lyp/garfield++/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/lyp/garfield++/root/include/ROOT/RStringView.hxx:48:53: error: ‘pos’ was not declared in this scope; did you mean ‘pow’?  
48 | inline double stod(std::string\_view str, size\_t pos)  
| ^~~  
| pow  
/home/lyp/garfield++/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/lyp/garfield++/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/lyp/garfield++/root/include/ROOT/RStringView.hxx: In function ‘std::string& std::\_\_ROOT::operator+=(std::string&, int)’:  
/home/lyp/garfield++/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/lyp/garfield++/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/lyp/garfield++/root/include/ROOT/RStringView.hxx: At global scope:  
/home/lyp/garfield++/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/lyp/garfield++/root/include/TCollection.h:29,  
from /home/lyp/garfield++/root/include/TSeqCollection.h:25,  
from /home/lyp/garfield++/root/include/TList.h:25,  
from /home/lyp/garfield++/root/include/TQObject.h:40,  
from /home/lyp/garfield++/root/include/TVirtualPad.h:30,  
from /home/lyp/garfield++/root/include/TPad.h:15,  
from /home/lyp/garfield++/garfieldpp-4.0/Include/Garfield/ViewBase.hh:8,  
from /home/lyp/garfield++/garfieldpp-4.0/Include/Garfield/ViewDrift.hh:12,  
from /home/lyp/garfield++/garfieldpp-4.0/Include/Garfield/AvalancheMC.hh:10,  
from /home/lyp/garfield++/garfieldpp-4.0/Examples/Geant4GarfieldInterface/src/GarfieldPhysics.cc:31:  
/home/lyp/garfield++/root/include/TString.h:115:13: error: expected type-specifier  
115 | operator std::string\_view() const { return std::string\_view(Data(),fExtent); }  
| ^~~  
/home/lyp/garfield++/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/lyp/garfield++/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/lyp/garfield++/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/lyp/garfield++/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/lyp/garfield++/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/lyp/garfield++/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/lyp/garfield++/root/include/TCollection.h:29,  
from /home/lyp/garfield++/root/include/TSeqCollection.h:25,  
from /home/lyp/garfield++/root/include/TList.h:25,  
from /home/lyp/garfield++/root/include/TQObject.h:40,  
from /home/lyp/garfield++/root/include/TVirtualPad.h:30,  
from /home/lyp/garfield++/root/include/TPad.h:15,  
from /home/lyp/garfield++/garfieldpp-4.0/Include/Garfield/ViewBase.hh:8,  
from /home/lyp/garfield++/garfieldpp-4.0/Include/Garfield/ViewDrift.hh:12,  
from /home/lyp/garfield++/garfieldpp-4.0/Include/Garfield/AvalancheMC.hh:10,  
from /home/lyp/garfield++/garfieldpp-4.0/Examples/Geant4GarfieldInterface/src/GarfieldPhysics.cc:31:  
/home/lyp/garfield++/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/lyp/garfield++/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/lyp/garfield++/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/lyp/garfield++/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/lyp/garfield++/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/lyp/garfield++/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/lyp/garfield++/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/lyp/garfield++/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[2]: \*\*\* [Examples/Geant4GarfieldInterface/CMakeFiles/exampleGeant4Interface.dir/build.make:128：Examples/Geant4GarfieldInterface/CMakeFiles/exampleGeant4Interface.dir/src/GarfieldPhysics.cc.o] 错误 1  
make[1]: \*\*\* [CMakeFiles/Makefile2:1174：Examples/Geant4GarfieldInterface/CMakeFiles/exampleGeant4Interface.dir/all] 错误 2  
make: \*\*\* [Makefile:130：all] 错误 2

---

<div class="post-metadata">

**Author:** ![lyp](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/ecc23a/32.png) [@lyp](https://root-forum.cern.ch/u/lyp)\
**Post date:** [July 22, 2021, 1:34am UTC](https://root-forum.cern.ch/t/problem-in-installation/45918/7 "2021-07-22T01:34:08Z")

</div>

I am sorry …the web is allowed to upload a txt file.  
Here is the txt file

[code.txt](https://root-forum.cern.ch/uploads/short-url/p8OZ019qk8Uo71eRljjurQQeFBT.txt) (21.0 KB)

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [July 22, 2021, 7:34am UTC](https://root-forum.cern.ch/t/problem-in-installation/45918/8 "2021-07-22T07:34:22Z")

</div>

You need to make sure that the same “`-std=...`” C++ compiler flag is used when building all your software.

See, for example, what “`-std`” your ROOT is using: `root-config --cflags`

The missing `"G4GDMLParser.hh"` error suggests that your Geant4 was built without the optional GDML support (e.g., without “`-DGEANT4_USE_GDML=ON`”).

---

<div class="post-metadata">

**Author:** ![lyp](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/ecc23a/32.png) [@lyp](https://root-forum.cern.ch/u/lyp)\
**Post date:** [July 23, 2021, 7:02am UTC](https://root-forum.cern.ch/t/problem-in-installation/45918/9 "2021-07-23T07:02:33Z")

</div>

Thank your for your reply.  
I have resolved gdml problem. I don’t really understand what the flag “-std” means. I input the command " root -config --cflags " then it displayed a lot of parameters.

So how should i do to use c++17 make the file? Is that c++17 contains the variable “std” and “string\_view” ? Could you give me a detailed solution？ 😭  
（ps: I directly used apt-get command to install my gcc and cmake app）

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [July 23, 2021, 7:16am UTC](https://root-forum.cern.ch/t/problem-in-installation/45918/10 "2021-07-23T07:16:49Z")

</div>

One of the first flags in the output of “`root-config --cflags`” is " `-std=...`" (and this tells you what C++ language standard your ROOT binaries were built with).

Search for “`-std=`” in “`man g++`” for more info.

BTW. You should also be able to learn what C++ language standard your Geant4 binaries were built with: `geant4-config --cxxstd`

---

<div class="post-metadata">

**Author:** ![lyp](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/ecc23a/32.png) [@lyp](https://root-forum.cern.ch/u/lyp)\
**Post date:** [July 23, 2021, 7:34am UTC](https://root-forum.cern.ch/t/problem-in-installation/45918/11 "2021-07-23T07:34:34Z")

</div>

![2021-07-23 15-33-25 的屏幕截图](https://root-forum.cern.ch/uploads/default/original/3X/5/c/5c2883701dd7fcb38ac932e855670a7c607cd1b9.png)

Seem like standard of ROOT is c++14 and standard of geant4 is c++11  
How to change to c++17?

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [July 23, 2021, 7:37am UTC](https://root-forum.cern.ch/t/problem-in-installation/45918/12 "2021-07-23T07:37:08Z")

</div>

You can build a `c++14` aware Geant4 using: `cmake -DGEANT4_BUILD_CXXSTD=14 ...`

If you want to have everything using `c++17`, you need to build ROOT using “`cmake -DCMAKE_CXX_STANDARD=17`” and Geant4 using “`cmake -DGEANT4_BUILD_CXXSTD=17`”

Note that, afterward, in any case, you also need to build Garfield++ with the same C++ standard (I guess @hschindl can tell you how).

---

<div class="post-metadata">

**Author:** ![hschindl](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/977dab/32.png) [@hschindl](https://root-forum.cern.ch/u/hschindl)\
**Post date:** [July 23, 2021, 7:56am UTC](https://root-forum.cern.ch/t/problem-in-installation/45918/13 "2021-07-23T07:56:53Z")

</div>

Hi,  
to set the C++ standard to be used for building Garfield++ explicitly, you can use the flag `CMAKE_CXX_STANDARD` (same as for ROOT).

---

<div class="post-metadata">

**Author:** ![lyp](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/ecc23a/32.png) [@lyp](https://root-forum.cern.ch/u/lyp)\
**Post date:** [July 23, 2021, 8:43am UTC](https://root-forum.cern.ch/t/problem-in-installation/45918/15 "2021-07-23T08:43:20Z")

</div>

My problem got solved perfectly! Thank you very much sir!

---

<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:** [August 6, 2021, 8:43am UTC](https://root-forum.cern.ch/t/problem-in-installation/45918/16 "2021-08-06T08:43:25Z")

</div>

Closed on August 6, 2021, 8:43am UTC

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