Smoothed particle hydrodynamic (SPH) method is used to solve a variety of complex engineering problems. In the literature about SPH, there are two approaches to solving the pressure component of momentum conservation equation, namely incompressible SPH (ISPH) and weakly compressible SPH (WCSPH) methods. In this paper, we present a new comparative study of WCSPH (Lagrange), ISPH (Lagrange) and ISPH (Euler) methods, focusing on heat conduction issue by numerical solutions of natural convection in a square cavity. Temperature distributions, velocity distributions and Nusselt number distributions at different Rayleigh numbers (Ra=104, 105, 106) are provided in the paper. The quantitative comparisons of results show that WCSPH (Lagrange), ISPH (Lagrange) and ISPH (Euler) methods all perform very well at low Rayleigh number. And at high Rayleigh number, SPH (Lagrange) needs shifting particle technology to correct the distribution of particles, ISPH (Euler) performs best because of the motionless particles, WCSPH (Lagrange) performs better than ISPH (Lagrange).