In reply to zz8318:
DPI imports/exports do not need to be in a module.
Did you follow all the advice given by the error message? Did you package import the DPI exported function into the module where you called the DPI imported function?
A complete skeletal example that reproduces the problem would really help.