This paper has focused on the dynamic analysis of mechanisms with closed-loop configuration while considering the flexibility of links. In order to present a general formulation for such a closed-loop mechanism, it is allowed to have any arbitrary number of flexible links in its chain-like structure. The truncated assumed modal expansion technique has been used here to model link flexibility. Moreover, due to the closed nature of the mentioned mechanism, which imposes finite holonomic constraints on the system, the appearance of Lagrange multipliers in the dynamic motion equations obtained by Lagrangian formulation is unavoidable. So, the Gibbs-Appell (G-A) formulation has been applied to get rid of these Lagrange multipliers and to ease the extraction of governing motion equations. In addition to the finite constraints, the impulsive constraints, which originate from the collision of system joints with the ground, have also been formulated here using the Newton's kinematic impact law. Finally, to stress the generality of the proposed formulation in deriving and solving the motion equations of complex closed-loop mechanisms in both the impact and non-impact conditions, the computer simulation results for a mechanism with four flexible links and closed-loop configuration have been presented.