A method to generate a weight function for use in the stress analysis of arbitrarily shaped cracks with arbitrary boundary conditions and mixed mode loading is presented. The method only involves the numerical resolution of a singular integral equation with a Cauchy–type kernel whose singularity is straight forward to remove. The generation of the weight function is done through the superposition of a fundamental solution and a complementary solution. The fundamental solution obeys the complex Bueckner formula asymptotically and has a finite traction potential along the curved crack. The complementary solution is made up of a distributed load plus a simple crack solution such that the weight function is stress free along the crack and has the right boundary conditions. Only the simple crack solution needs to be solved using the numerical resolution of a singular integral equation with a Cauchy–type kernel. A numerical example is added to illustrate the method.