cxwx
November 24, 2019, 6:15pm
1
I try to use root with shared libsofa_c.dylib (http://www.iausofa.org/current_C.html#Downloads )
gSystem->Load("lib/libsofa_c.dylib");
run after g++ compile, is OK.
but
root pro1.cpp
cause
IncrementalExecutor::executeFunction: symbol 'iauDtf2d' unresolved while linking function '_GLOBAL__sub_I_cling_module_32'!
anybody know that which situation could cause the problem?
_ROOT Version:6.18.04 homebrew
_Platform:mac OS X catalina
Axel
November 25, 2019, 8:11am
2
I don’t see pro1.cpp
in the library sources.
You likely need to load the library before running code from it. I’m not sure what your issue is here?
Axel.
cxwx
November 25, 2019, 9:46am
3
I’m sorry. I did not make it clear
pro1.cpp has the code below
void pro1()
{
gSystem->Load("lib/libsofa_c.dylib");
iauDtf2d(...);
}
int main(){pro1();}
with
g++ `root-config --libs --cflags` -lsofa_c
this is OK.
but below
root -l -b -q pro1.cpp
cause the problem
IncrementalExecutor::executeFunction: symbol 'iauDtf2d' unresolved while linking function '_GLOBAL__sub_I_cling_module_32'!
I built libsofa_c with gcc -fPIC -dynamiclib
Axel
November 25, 2019, 10:10am
4
When pro1.cpp
gets “compiled” in the interpreter it needs to find the symbol for iauDtf2d
- which is only provided when running pro1()
, which is too late. Instead please use
R__LOAD_LIBRARY(lib/libsofa_c.dylib)
void pro1()
{
iauDtf2d(...);
}
int main(){pro1();}
1 Like
system
Closed
December 9, 2019, 10:37am
6
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.