Study about theory and algorithms for nonlinear programming usually assumes that the feasible region of the problem is nonempty. However, there are many important practical nonlinear programming problems whose feasible regions are not known to be nonempty or not, and optimizers of the objective function with the least constraint violation prefer to be found. A natural way for dealing with these problems is to extend the nonlinear programming problem as the one optimizing the objective function over the set of points with the least constraint violation. Firstly, the minimization problem with least constraint violation is proved to be a Lipschitz equality constrained optimization problem when the original problem is a convex nonlinear programming problem with possible inconsistent constraints, and it can be reformulated as an MPCC problem; And the minimization problem with least constraint violation is relaxed to an MPCC problem when the original problem is a nonlinear programming problem with possible inconsistent non-convex constraints. Secondly, for nonlinear programming problems with possible inconsistent constraints, it is proved that a local minimizer of the MPCC problem is an M-stationary point and an elegant necessary optimality condition, named as L-stationary condition, is established from the classical optimality theory of Lipschitz continuous optimization. Thirdly, properties of the penalty method for the minimization problem with the least constraint violation are developed and the proximal gradient method for the penalized problem is studied. Finally, the smoothing Fischer-Burmeister function method is constructed for solving the MPCC problem related to minimizing the objective function with the least constraint violation. It is demonstrated that, when the positive smoothing parameter approaches to zero, any point in the outer limit of the KKT-point mapping is an L-stationary point of the equivalent MPCC problem.