Details
-
Bug
-
Status: Closed (View Workflow)
-
Blocker
-
Resolution: Fixed
-
6.08/06, 6.10/08, 6.12/04
-
None
-
MacOS X 10.13.3, Xcode 9.2
Description
Hi,
I ran into a very strange issue today. While trying to debug something else, I noticed that when I build a shared library that has dictionaries for some very simple types, I'm unable to make interactive ROOT find these types automatically. Attached is a simple example.
When I build the code, I get a rootmap file with this exact content:
libMyTestLibrary.rootmap |
[ libMyTestLibrary.so ]
|
# List of selected classes
|
class MyTestClass
|
header MyTestClass.h
|
But if I try to use MyTestClass in an interactive ROOT session, that doesn't work.
[bash][tauriel]:rootRootmapError > root -l
|
root [0] MyTestClass c;
|
ROOT_prompt_0:1:12: error: expected ';' after expression
|
MyTestClass c;
|
^
|
;
|
ROOT_prompt_0:1:13: error: use of undeclared identifier 'c'
|
MyTestClass c;
|
^
|
root [1]
|
Looking a bit closer at it, I see the following:
[bash][tauriel]:rootRootmapError > root -l
|
root [0] gInterpreter->GetMapfile()->Print();
|
...
|
TMinuitMinimizer.h: libMinuit.so [Changed]
|
gMinuit: libMinuit.so [Changed]
|
[: libMyTestLibrary.so ] [Global]
|
class: MyTestClass [Global]
|
header: MyTestClass.h [Global]
|
root [1]
|
Something is clearly very broken here... It took a while before I could find a way to "fix" the issue. Turns out, if I add one empty line at the beginning of libMyTestLibrary.rootmap, then everything starts working. (Please try it.)
Note that as soon as there library is "more complicated", like if there's a namespace in it, then the formatting of the rootmap file changes such that it becomes "parseable". That's why I didn't run into this issue before. But clearly it's a very serious problem if we can't build such simple libraries...
Cheers,
Attila