  In this paper we determine the integral homology and cohomology groups of a
closed 4-manifold X obtained as the generalized fibre sum of two closed
4-manifolds M and N along embedded surfaces of genus g and self-intersection
zero. If the homologies of the 4-manifolds are torsion free and the surfaces
represent indivisible homology classes, we derive a formula for the
intersection form of X. If in addition the 4-manifolds M and N are symplectic
and the surfaces symplectically embedded we derive a formula for the canonical
class of the symplectic fibre sum.
