  We present an overview of Gromov-Witten theory and its links with string
theory compactifications, focussing on the GW potential as the generating
function for topological string amplitudes at genus $g$. Restricting to
Calabi-Yau target spaces, we give a complete derivation of the GW potential,
discuss problems of multicovers and the infinite product expression. We explain
the link with counting instantons or BPS states in type IIA and heterotic
string theories. We show why the numbers of BPS states on the heterotic side
can be a priori expressed in terms of those on the type IIA side, and vice
versa. We compute heterotic one-loop integrals to obtain the genus $g$ GW
potential, and detail two ways to obtain threshold corrections for heterotic
orbifolds, a prerequisite for the notorious work by Harvey and Moore. We review
this long and cumbersome construction in a self-contained way and make it
explicit in examples of compactifications. We also develop the relation to
Jacobi forms and automorphic forms, and clarify the meaning of the
Gopakumar-Vafa invariants.
