I have been trying to use the C-version of the Naval Observatory Vector Astronomy Subroutines (NOVAS), mostly because it has a wrapper for the JPL Ephemeris fortran routines (yes, I need that much precision!). I can compile, link and create a shared library, and use this shared library with a compiled C++ program (main.c) The thing is, when I try to use the library in an ACLiC-compiled ROOT macro, it loads, but I get an undefined symbol error . I have attached a .tar.gz archive, which includes the library, the headers that need to be included, a macro called RunTestNovas.C that loads the library and loads the macro TestNovas.C. TestNovas.C has the function that I am trying to call from the library, julian_date. Thanks in advance!
When using a C library from a C++ program you must specify, eg in your case
extern "C" { double julian_date (short int year, short int month, short int day,
double hour);
}
i in your C++ file. Note that your example does not work without this specification when compiling TestNovas.C (as main) and libnovas.so.
The following version of TestNovas.C will work with the compiler and ACLIC
Rene
[code]#include <stdio.h>
extern “C” { double julian_date (short int year, short int month, short int day,
double hour);}