Failed at linking stage with ACLiC on OSX system

Hi All,

I am trying to load and execute some scripts with ACLiC that use some custom shared libraries, but it seems that the system cannot link the functions I made. All these librarries are loaded at start with the ~/.rootlogon.C and I can use them interactively from the CINT session. However if I try to link them to my script I get linking errors like in the following example:

root [] .L test.cpp++
Info in <TMacOSXSystem::ACLiC>: creating shared library /Users/francesco/tmp/./
Undefined symbols for architecture x86_64:
  "Analysis::DetermineProbInt(std::__1::vector<double, std::__1::allocator<double> >&, double, double&, double&, bool)", referenced from:
      test::testfnc() in test_cpp_ACLiC_dict.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Error in <ACLiC>: Compilation failed!

This linking problem appears only on my laptop on ROOT 5.34.34 and OSX 10.8.5, while I dont get any problem on the linux system (same ROOT version). In both the systems the shared libraries are built and installed using exactly the same CMakeLists.txt file.
I think that the problem has something to do with the clang as pointed out in this post [url]Problems using ACLiC on Mac OS X v10.6 that I followed to modify properly the CMakeLists.txt file.

Also, here there are the lines I added to the ~/.rootrc file:

Unix.*.Root.DynamicPath:    .:$(ROOTSYS)/lib:$(HOME)/lib:$(HOME)/lib/xurich
Unix.*.Root.MacroPath:      .:$(ROOTSYS)/macros:$(HOME)/xurich/analysis/scripts:

#Root.ShowPath: true

Rint.Includes: 2
Rint.Logon: ~/.rootlogon.C

ACLiC.IncludePaths:    -I. -I$(ROOTSYS)/include -I$(HOME)/xurich/analysis/code/include -I$(HOME)/include
#ACLiC.LinkLibs: 3

You can find attached the relevant header and source files used to make a test, the linkdef.h file and the CMakeLists.txt used to build and install the libraries.

test.cpp (1.14 KB)
Functions.hh (2.88 KB)
CMakeLists.txt (3.54 KB)
linkdef.h (626 Bytes)


Where is DetermineProbInt defined? I.e. where is its body? You compile a function that calls it (test::testfnc()) and thus it needs to be available.

Cheers, Axel.

Hi Axel,

thank you for the answer.
In the previous post I have uploaded only the relevant headers. The source file is a which is the “[…]/code/src/shared” directory, the headers are in the “[…]/code/include/shared” directory and the CMakeList.txt is in the “[…]/code” directory.
Now you can find attached the “” too, in order to get an idea what are the definitions. (11 KB)