I have a suspicion that your project isn't quite set up right.
You have "main.agc" being included by your file and that is not right.
main.agc may include lots of other files, but you should NOT include it in other files.
It is the main.agc file that is the head of the compile loop and you are probably including things in a strange way, based on the posted sample.
Now, can you show how you are using the two functions posted.
But first try removing the include statement for main.agc and see what impact that has.
Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master