  Carath\'eodory functions, i.e. functions analytic in the open upper
half-plane and with a positive real part there, play an important role in
operator theory, $1D$ system theory and in the study of de Branges-Rovnyak
spaces. The Herglotz integral representation theorem associates to each
Carath\'eodory function a positive measure on the real line and hence allows to
further examine these subjects. In this paper, we study these relations when
the Riemann sphere is replaced by a real compact Riemann surface. The
generalization of Herglotz's theorem to the compact real Riemann surface
setting is presented. Furthermore, we study de Branges-Rovnyak spaces
associated with functions with positive real-part defined on compact Riemann
surfaces. Their elements are not anymore functions, but sections of a related
line bundle.
