# Garfield++ error

**URL:** <https://root-forum.cern.ch/t/garfield-error/62948>\
**Category:** Garfield++\
**Created:** [February 15, 2025, 6:05am UTC](https://root-forum.cern.ch/t/garfield-error/62948 "2025-02-15T06:05:14Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![xuzh](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/x/34f0e0/32.png) [@xuzh](https://root-forum.cern.ch/u/xuzh)\
**Post date:** [February 15, 2025, 6:05am UTC](https://root-forum.cern.ch/t/garfield-error/62948/1 "2025-02-15T06:05:15Z")

</div>

I am getting the following error reported when installing Garfield++:

 ![微信图片_20250215135842](https://root-forum.cern.ch/uploads/default/original/3X/a/9/a95ef281567488fb6cca74d49a2154d225876010.png)

 ![微信图片_20250215140053](https://root-forum.cern.ch/uploads/default/original/3X/b/0/b04b0a10047449027692a45724138adff66d8375.png)  
For this I reinstalled ROOT again and specifically added -DCMAKE\_CXX\_STANDARD=17 to the cmake command line. my version of ROOT is 6.30.4. I use the command “root-config --cflags”, and it shows:“-pthread -std=c++17 -m64 -I/home/xuzh/software/root/root\_install/include”.  
Does this mean my ROOT installation is fine?And what is the problem?

---

<div class="post-metadata">

**Author:** ![Danilo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/danilo/32/34528_2.png) [@Danilo](https://root-forum.cern.ch/u/Danilo)\
**Post date:** [February 15, 2025, 7:26am UTC](https://root-forum.cern.ch/t/garfield-error/62948/2 "2025-02-15T07:26:00Z")

</div>

Hi,

Adding @hschindl in the loop.

Best,  
D

---

<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:** [February 15, 2025, 9:39am UTC](https://root-forum.cern.ch/t/garfield-error/62948/3 "2025-02-15T09:39:44Z")

</div>

Hi,  
did you build ROOT yourself or are you using a precompiled binary distribution?  
Which platform and compiler are you using?

---

<div class="post-metadata">

**Author:** ![xuzh](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/x/34f0e0/32.png) [@xuzh](https://root-forum.cern.ch/u/xuzh)\
**Post date:** [February 15, 2025, 2:07pm UTC](https://root-forum.cern.ch/t/garfield-error/62948/4 "2025-02-15T14:07:23Z")

</div>

Hello. I installed ROOT by source code. My system is Ubuntu22.04 and my compiler is GCC 11.4.0.

---

<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:** [February 15, 2025, 4:27pm UTC](https://root-forum.cern.ch/t/garfield-error/62948/6 "2025-02-15T16:27:46Z")

</div>

Hm, strange. I don’t have access to a Ubuntu machine, but the Gitlab pipeline based on the “root:6.30.04-ubuntu22.04” Docker image seems to build fine. Normally you shouldn’t need to specify the C++ standard explicitly…  
@Danilo any idea what could be wrong?

---

<div class="post-metadata">

**Author:** ![xuzh](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/x/34f0e0/32.png) [@xuzh](https://root-forum.cern.ch/u/xuzh)\
**Post date:** [February 16, 2025, 4:06am UTC](https://root-forum.cern.ch/t/garfield-error/62948/7 "2025-02-16T04:06:32Z")

</div>

For this reason I also reinstalled geant4 again, still specifying the C++ standard as 17. Despite the reinstallation of both geant4 and root, the reported error persists. I’m not too well versed in this as I’m new to it as well.

---

<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:** [February 16, 2025, 2:22pm UTC](https://root-forum.cern.ch/t/garfield-error/62948/8 "2025-02-16T14:22:30Z")

</div>

Can you try with a precompiled binary distribution of ROOT?

> **[Releases](https://root.cern/install/all_releases/)**
>
> Data Analysis Framework

---

<div class="post-metadata">

**Author:** ![xuzh](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/x/34f0e0/32.png) [@xuzh](https://root-forum.cern.ch/u/xuzh)\
**Post date:** [February 17, 2025, 1:07am UTC](https://root-forum.cern.ch/t/garfield-error/62948/9 "2025-02-17T01:07:37Z")

</div>

OK, I will try a precompiled version.

---

<div class="post-metadata">

**Author:** ![xuzh](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/x/34f0e0/32.png) [@xuzh](https://root-forum.cern.ch/u/xuzh)\
**Post date:** [February 17, 2025, 1:35am UTC](https://root-forum.cern.ch/t/garfield-error/62948/10 "2025-02-17T01:35:01Z")

</div>

I used a precompiled binary distribution of ROOT(version 6.30.4), it still reported the same errors.

---

<div class="post-metadata">

**Author:** ![xuzh](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/x/34f0e0/32.png) [@xuzh](https://root-forum.cern.ch/u/xuzh)\
**Post date:** [February 17, 2025, 2:18am UTC](https://root-forum.cern.ch/t/garfield-error/62948/11 "2025-02-17T02:18:21Z")

</div>

I’ve solved the problem. The solution was to add ‘set(CMAKE\_CXX\_STANDARD 17)’ to the first line of Garfield++'s CMakeList.txt file, which looks like it needs to force the C++ standard to be specified, rather than having it auto-detect the ROOT’s C++ standard.  
Thanks again for your advice and help!

---

<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 3, 2025, 2:19am UTC](https://root-forum.cern.ch/t/garfield-error/62948/12 "2025-03-03T02:19:01Z")

</div>

Closed on March 3, 2025, 2:19am UTC

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