Degree of meromorphic function and meromorphic 1-form on compact Riemann surface Let $X$ be compact Riemann surface, given a nonconstant meromorphic function $f$ on it, it's well known that the $\deg \text{div}f = 0$ (due to the fact that degree is constant on each fiber), where $\text{div}$ denotes taking divisor of $f$.
And we also have meromorphic 1-form $\alpha  = fdz$, the result is that $\deg \text{div} \alpha = 2g -2$( $g$ is the genus of the surface). (for example in Donaldson's book, take a  smooth 1-form such that multiplicity of zeros equals to the degree of $\alpha$ and can be proved multiplicity of zeros for smooth 1-form is topological invariant $2g-2$)

Why they are different? why degree of the divsor of the meromorphic function is zero while for meromorphic 1-form is 2g-2?Do I misunderstand somewhere?
 A: Well, a function is just a different thing from a 1-form.  You may be used to working in $\mathbb{C}$ where a 1-form is essentially the same thing as a function, since any function $f$ gives a 1-form $fdz$ and conversely.  On a Riemann surface, though, there is no "$dz$" which you can just multiply any function by to get a 1-form with the same zeroes and poles.  Locally near any point you can define a 1-form "$dz$" using a holomorphic chart, but these will not necessarily glue together to give a well-defined 1-form on the entire surface.  (If a Riemann surface $X$ does have a holomorphic nowhere vanishing 1-form $\omega$, then there is a bijection between meromorphic functions and meromorphic 1-forms given by $f\mapsto f\omega$ which preserves zeroes and poles.  However, a compact Riemann surface turns out to have such an $\omega$ only if its genus is $1$.)
The example of $X=\mathbb{C}\cup\{\infty\}$ is perhaps instructive.  On $\mathbb{C}$, there is the usual 1-form $dz$, which has no zeroes or poles.  However, when you extend it to $\infty$, it actually has a double pole at $\infty$.  Indeed, a local coordinate near $\infty$ is given by $w=1/z$, so $dz$ turns into $d(1/w)=-dw/w^2$, which has a double pole at $w=0$ (corresponding to $z=\infty$).  So on $\mathbb{C}\cup\{\infty\}$ there is the constant holomorphic function $1$ which has degree $0$, but if you turn it into a 1-form $1\cdot dz$, this 1-form actually has degree $-2$ since it has a double pole at $\infty$.
