TTree cannot be linked.
Dear Colleagues
Hello, I'm now trying to use TTree to collect and save data from silicon pixel simulation, but Garfieldpp's findROOT seems it cannot link TTree class. Following is my error message during make.
[ 87%] Linking CXX executable ../bin/alpide_3d Undefined symbols for architecture x86_64: "TTree::TTree(char const*, char const*, int, TDirectory*)", referenced from: Experiment(int, TString, TString, TString, int, TApplication*) in alpide_3d.C.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: *** [bin/alpide_3d] Error 1 make[1]: *** [Examples/CMakeFiles/alpide_3d.dir/all] Error 2 make: *** [all] Error 2
To ensure linked properties, I also do make VERBOSE=1
, and following is output.
[ 86%] Linking CXX executable ../bin/alpide_3d cd /Users/isaac/opt/garfieldpp/build/Examples && /usr/local/Cellar/cmake/3.14.4/bin/cmake -E cmake_link_script CMakeFiles/alpide_3d.dir/link.txt --verbose=1 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -W -Wall -pedantic -Wno-non-virtual-dtor -Wno-long-long -Wwrite-strings -Wpointer-arith -Woverloaded-virtual -Wno-variadic-macros -Wshadow -pipe -Qunused-arguments -DGL_SILENCE_DEPRECATION -stdlib=libc++ -DG4USE_STD11 -pthread -ftls-model=initial-exec -std=c++11 -DNDEBUG -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/alpide_3d.dir/Jeong/alpide_3d.C.o -o ../bin/alpide_3d -L/Users/isaac/opt/root-6.18.04/lib -Wl,-rpath,/Users/isaac/opt/root-6.18.04/lib -Wl,-rpath,/Users/isaac/opt/garfieldpp/build/lib ../lib/libGarfield.0.3.0.dylib /Users/isaac/opt/root-6.18.04/lib/libGdml.so /Users/isaac/opt/root-6.18.04/lib/libGeom.so /Users/isaac/opt/root-6.18.04/lib/libXMLIO.so /Users/isaac/opt/root-6.18.04/lib/libGraf3d.so /Users/isaac/opt/root-6.18.04/lib/libGpad.so /Users/isaac/opt/root-6.18.04/lib/libGraf.so /Users/isaac/opt/root-6.18.04/lib/libHist.so /Users/isaac/opt/root-6.18.04/lib/libRIO.so /Users/isaac/opt/root-6.18.04/lib/libMatrix.so /Users/isaac/opt/root-6.18.04/lib/libMathCore.so /Users/isaac/opt/root-6.18.04/lib/libImt.so /Users/isaac/opt/root-6.18.04/lib/libThread.so /Users/isaac/opt/root-6.18.04/lib/libCore.so Undefined symbols for architecture x86_64: "TTree::TTree(char const*, char const*, int, TDirectory*)", referenced from: Experiment(int, TString, TString, TString, int, TApplication*) in alpide_3d.C.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: *** [bin/alpide_3d] Error 1 make[1]: *** [Examples/CMakeFiles/alpide_3d.dir/all] Error 2 make: *** [all] Error 2
There's no libTree.so. I've tried to compile manually, with appending "/Users/isaac/opt/root-6.18.04/lib/libTree.so" at the end of arguments of path/to/c++ command, the compilation is working.
Maybe I think there's no method to find libTree.so in cmake procedures.
I don't know how to fix this one, but you may know how to fix. Could you please to add some of lines in cmake methods and fix this problem?