  We study correlation functions in topologically twisted $\mathcal{N}=2, d=4$
supersymmetric Yang-Mills theory for gauge groups of rank larger than one on
compact four-manifolds $X$. We find that the topological invariance of the
generator of correlation functions of BRST invariant observables is not spoiled
by noncompactness of field space. We show how to express the correlators on
simply connected manifolds of $b_{2,+}(X)>0$ in terms of Seiberg-Witten
invariants and the classical cohomology ring of $X$. For manifolds $X$ of
simple type and gauge group SU(N) we give explicit expressions of the
correlators as a sum over $\mathcal{N}=1$ vacua. We describe two applications
of our expressions, one to superconformal field theory and one to large $N$
expansions of SU(N) $\mathcal{N}=2, d=4$ supersymmetric Yang-Mills theory.
