It seems that the error makes even less sense after this round of testing. What happens if you include only the cart definition file, but move the GetContents function so that it is the first one listed in the file?
If you can do this and get a message that says you can't redeclare the function then there must be something else going on that we are not thinking about.