Some error messages are a bit cryptic. This article will explain all, or at least some:
Already referenced name as import
This just means you called a function before you used it. Move the function call after the function declaration. It may be that this particular message only occurs if your function is imported in a struct in the module/global header.
|This article is a stub.|
You can help by .