Calling functions from a separate addon

I've got 2 addon's I'm developing, and I need functionality from one func.php file into the other.

I try to call the method in addon2/func.php from addon1/func.php, and I get an error saying 'Call to undefined function'. I don't understand this, because when I try to include the addon2/func.php file, I get an error saying I cannot redeclare the function. So it looks like it has to be loading somewhere, even though it isn't letting me access it?

This is odd because we have another 2 addons, where one uses functions from another, and it works fine with no errors or extra file includes.

Any help or advice would be appreciated.


Nevermind, I got it figured out. I was trying to call the function from an ajax page and had to include the func.php file from the ajax page instead of the other func.php file.