I am reading "Compact Riemann Surfaces" by Raghavan Narashimhan. Say X be a compact Riemann surface; after proving that the degree of the canonical bundle $K_X$ is $2g-2$ (using Riemann-Roch), where $g$ is the genus, he just says that Equivalently if $w\neq 0$ is any meromorphic $1$-form, the degree of the divisor of $w$ is $2g-2$. I can't see it. How does it follow from the previous line? I might be missing something very obvious. Still an explanation would be very helpful.
This is actually easy once one understands the definition of the canonical line bundle properly $: K_X$ is a line bundle such that for any open set $U\subset X, H^0(U,K_X)=\Omega_X(U)=$ space of holomorphic $1$-forms on $U$. Here meromorphic sections of $K_X$ correspond to meromorphic $1$-forms.
Now, the degree of $K_X$ is actually degree of any section of $K_X$ (holomorphic or meromorphic). Let $s$ be the meromorphic section of $K_X$ corresponding to $w$. So, degree of $w$ = degree of $s$ = degree of $K_X=2g-2$.