It looks to me as a configuration problem with building your tool with cmake. When building you need to add the dependency on the ROOT core libraries, like libCore and libMathCore. Did you define ROOTSYS when building your fitter tool ?
Yes this are the right libraries. But you need to include them in the CMakefiles. You are not using ROOT as a package, like for example in this repo, https://github.com/root-project/rootbench, but adding by using the output of root-config.
Are you sure the libraries are propagated correctly when linking ?
I think they are included in the CMakefile. Here is the part of it that is dealing with ROOT:
# ROOT
if ( NOT DEFINED ENV{ROOTSYS} )
cmessage(FATAL_ERROR "$ROOTSYS is not defined, please set up root first.")
else()
cmessage(STATUS "Using ROOT installed at $ENV{ROOTSYS}")
set(CMAKE_ROOTSYS $ENV{ROOTSYS})
endif()
#If you want to try an use the terminally buggy ROOT CMake scripts
if (USEROOTCMAKE)
include ($ENV{ROOTSYS}/etc/cmake/FindROOT.cmake)
if ( NOT ROOT_FOUND )
cmessage(FATAL_ERROR "[ROOT]: FindROOT.cmake could not be found, or did not execute as expected is ROOT installed in $ROOTSYS = $ENV{ROOTSYS}?")
endif()
else()
cmessage(STATUS "Including local GENERATE_ROOT_DICTIONARY implementation.")
include(${CMAKE_SOURCE_DIR}/cmake/GenROOTDictionary.cmake)
endif()
execute_process (COMMAND root-config --cflags OUTPUT_VARIABLE ROOT_CXX_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process (COMMAND root-config --libs OUTPUT_VARIABLE ROOT_LD_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process (COMMAND root-config --version OUTPUT_VARIABLE ROOT_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
cmessage(STATUS "[ROOT]: root-config --version: ${ROOT_VERSION}")
cmessage(STATUS "[ROOT]: root-config --cflags: ${ROOT_CXX_FLAGS}")
cmessage(STATUS "[ROOT]: root-config --libs: ${ROOT_LD_FLAGS}")