My _guess_ is that you do not have defined LNPUBLIC at the moment of xdb.dli inclusion.
You can see example of .dli usage in "Oracle" package - it is used to dynamicaly link with oracle client libraries.
I can create reference example for this, if somebody tells me to which .dll/.so link to, that exists both on Win32 and Linux (or at least has similar functionality).