【问题标题】:cmake error when i have tried to build a compilining?当我尝试构建编译时出现 cmake 错误?
【发布时间】:2021-01-10 22:52:52
【问题描述】:

我尝试通过“https://github.com/giglio0/DRAGON-G4-LaBr3.git”编译存储库,但是在编译时,我出错了。我不知道为什么会这样?我不是编码员。只是我想构建这个存储库并通过更改一些参数来运行模拟。错误输出是;

Scanning dependencies of target LaBr3_v4
[  9%] Building CXX object CMakeFiles/LaBr3_v4.dir/LaBr3_v4.cc.o
[ 18%] Building CXX object CMakeFiles/LaBr3_v4.dir/src/DetectorConstruction.cc.o
[ 27%] Building CXX object CMakeFiles/LaBr3_v4.dir/src/DetectorMessenger.cc.o
[ 36%] Building CXX object CMakeFiles/LaBr3_v4.dir/src/EventAction.cc.o
[ 45%] Building CXX object CMakeFiles/LaBr3_v4.dir/src/HistoManager.cc.o
/home/cancan/Gatev9/example_Geant4/LaBr/LaBr3/src/HistoManager.cc:29:10: fatal error: TH1D.h: No such file or directory
   29 | #include <TH1D.h>
      |          ^~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/LaBr3_v4.dir/build.make:134: CMakeFiles/LaBr3_v4.dir/src/HistoManager.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:95: CMakeFiles/LaBr3_v4.dir/all] Error 2
make: *** [Makefile:149: all] Error 2

谁能帮帮我?

【问题讨论】:

    标签: c++ linux cmake geant4


    【解决方案1】:

    显然你需要安装ROOT库,见:https://root.cern.ch/doc/master/classTH1.html

    顺便说一句,您要编译的应用程序 DRAGON-G4-LaBr3 的 READ.me 很糟糕。

    【讨论】:

      【解决方案2】:

      根据您的建议,我使用此命令再次安装 root-6.22.06;

      cmake -DCMAKE_INSTALL_PREFIX=/home/cancan/Gatev9/root-6.22.06-install /home/cancan/Gatev9/root-6.22.06 -Dall=ON
      

      我从某处了解到,如果我使用“-Dall=ON”,我可以安装所有 root 库,但它仍然无法正常工作。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2023-01-17
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-09-22
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多