Compilation with + postfix is not working

Hi.

I’m using a package called ANAROOT, which uses ROOT libraries.
Compilation of that package was just fine. It works.

Then, I got the other files creating a shared library using ANAROOT.f
If I create the shared library with “.L ShowPID.cc+”, it fails with

In file included from input_line_20:30:
AnaLoop/Core/include/TAlRawDataExample.hh:10:34: error: base class has incom
class TAlRawDataExample : public TArtAnaLoop
                          ~~~~~~~^~~~~~~~~~~
/home/s015/exp/exp1605_s015/anaroot/users/clem/src/include/TArtAnaFile.hh:14:7: note: forward declaration of 'TArtAnaLoop'
class TArtAnaLoop;
      ^
Error in <TInterpreter::AutoParse>: Error parsing payload code for class TArtValIndexVal with content:

The weird thing is, the shared library can be created by gcc with rootcling dictionary without any error
and fully works.

Could you give any clue on this?
Thank you in advance.

Obviously is missing the include file where the class TArtAnaLoop is defined. TArtAnaLoop.h ??
I am sure what you do when build the library with gcc and rootcling, but there must be something different. Can you provide more information? For example the ROOT version, the file ShowPID.cc, the makefile or instructions that work with gcc and rootcling, etc.

Sure.

The root version I used is 6.04/14.
When I did with + posfix, I just typed, .L ShowPID.cc+ after I loaded appropriate libraries with gSystem and adding header location with AddIncludePath to gInterpreter

and with rootcling

rootcling -f dict.cc ShowPID.hh linkdef.hh
gcc -fPIC -c dict.cc -I./include root-config --cflags
gcc -fPIC -c ShowPID.cc -I./include root-config --cflags
gcc -fPIC --shared -o ShowPID.so root-config --libs -L…/src/lib -lanaroot

The second method works, but the first doesn’t.
If you’re interested in testing with ANAROOT, you can download it from
ribf.riken.jp/RIBFDAQ/index.php … stallation

linkdef.hh (150 Bytes)
ShowPID.hh (1.61 KB)
ShowPID.cc (6.9 KB)

Try:
gSystem->Load(“lilbanaroot”);
.L ShowPID.cc+

[quote=“Pepe Le Pew”]Try:
gSystem->Load(“lilbanaroot”);
.L ShowPID.cc+[/quote]

Thanks for the reply.

Those needed libraries are automatically loaded with rootlogon.C file.
However, I tried for sure and same errors.

I could not reproduce the problem with master. Can you please try with 6.06.02?

Thank you.

I started to compile the latest version.
You saved my tomorrow :smiley:

Yeah…

Now I have this.

IncrementalExecutor::executeFunction: symbol ‘_ZNSsC1EOSs’ unresolved while linking [cling interface function]!
You are probably missing the definition of std::basic_string<char, std::char_traits, std::allocator >::basic_string(std::string&&)
Maybe you need to load the corresponding shared library?

As long as I googled it, it’s not cured yet…
It’s interesting that you don’t have this error.
Because of devtoolset I’m using maybe

I manually loaded the libraries and added the include path.
Then, the latest version gave me the same error.
Devtoolset environment is not good?

sft.its.cern.ch/jira/browse/ROOT-6207

See also How to build ROOT 6 on Scientific Linux

Thanks to the last two topic, I manage to solve the problem of string_basic problem.

But the original problem still occurs with no change.
The error message is slightly different for the first line and the others are the same.

In file included from analoop_dict dictionary payload:15:
/raid/01/home/s015/svn/2016SAMURAI.s015/sources/AnaLoop/Core/include/TAlRawDataExample.hh:10:34: error: base class has incomplete type
class TAlRawDataExample : public TArtAnaLoop
                          ~~~~~~~^~~~~~~~~~~
/home/s015/exp/exp1605_s015/anaroot/users/clem/src/include/TArtAnaFile.hh:14:7: note: forward declaration of 'TArtAnaLoop'
class TArtAnaLoop;
      ^
Error in <TInterpreter::AutoParse>: Error parsing payload code for class TArtValIndexVal with content:

#line 1 "analoop_dict dictionary payload"

#ifndef G__VECTOR_HAS_CLASS_ITERATOR
  #define G__VECTOR_HAS_CLASS_ITERATOR 1
#endif

.....................

Gosh. I solved problem with odd line.

Before “.L ShowPID.cc++”, I tried to add "#include "TArtAnaLoop.hh"
and then it went clean and sound…

I added include path with
gInterpreter -> AddIncludePath(“include”);
and libraries
gSystem -> Load(“libanaroot.so”);

I don’t know what’s the difference between explicitly type the line,
although it already exists in ShowPID.hh file…