Visual 2008 to Cygwin/ Linux Compiler Problem

Hi,

My problem is that a program that I compiled and run perfectly well in visual 08 doesn't compile when I am in linux/ cygwin environments.
Basically, I know it's to do with a global variable that I use in a number of the functions. The compiler in cygwin always outputs error:


       In function 'void Number of People<CP*>'
error: 'count' undeclared <first use this function>


where count is the global variable that I use.
Unfortunately, it outputs the same error message above for each function that I use count for.
Why is this problem occurring? Why does the compiler seem to recognize count as a function and not a variable? I have two other global variables which I only use in once, both in separate functions- and there is no error message for them.
Any suggestions on what I can do would be greatly appreciated.
There is a function in the <algorithm> header called count.
A possibility is that the compiler is trying to use this instead of your count variable.

What happens if you change your count variable name to something else like mycount ?
Code?
Usually, code moved to gcc from msvc that doesn't compile is down to missing typenames in places. Double check names declared in template classes/functions.
Topic archived. No new replies allowed.