tree is a type, not an instance variable you can use.
You have two things called 'tree' - one is "struct tree" and the other is a typedef name 'tree' which refers to 'struct tree'
You could remove the word typedef, which is redundant in C++ when it comes to declaring structs and classes.
Then you end up with a global variable called 'tree' which is of type 'struct tree'.