Due to the presence of corner eddies that change in number and pattern, the classical one-sided lid-driven cavity problem has been found to be particularly suitable to study various aspects of the performance of solution algorithms for incompressible viscous flows. More recently, the flow induced by the motion of two facing walls (two-sided lid-driven cavity) has also been investigated by Kuhlmann et al. For some aspect ratios this study demonstrates the existence of a multiplicity of solutions. However, for the aspect ratio of unity no multiplicity of solutions has been observed. Also it is found that for parallel motion of the walls, there appears a pair of counter-rotating secondary vortices of equal size near the centre of a wall. Because of symmetry, this pair of counter-rotating vortices has similar shapes and their detailed study as to how they grow with increasing Reynolds number has not yet been made. Such a study is attempted in this paper through the lattice Boltzmann method (LBM), as the problem has the potential of being used for testing various solution methods for incompressible viscous flows. The results for the antiparallel motion of the walls are also presented in detail. As the problem has not been investigated before, to lend credibility to the results they are further compared with those obtained from a finite difference method (FDM) code developed for this purpose.