By definition, the value of a decision variable is not known, until after you do a solve, so (pp[i] > 0) returns an IloRange object not a boolean so you get a compile-time error.
To minimize the positive parts of a variable pp[i] you need to define a second variable that is nonzero, but greater than pp[i].
IloNumVarArray pp(env, N, -50, 50, ILOFLOAT);
IloNumVarArray pp_positive(env, N, 0, IloInfinity, ILOFLOAT);
for (int i=0; i<N; ++i)
{
model.add(pp[i] - pp_positive[i] <= 0);
}
model.add(IloMinimize(env, IloSum(pp_postiive));
Because pp_positive appears only in the objective function, it will take on the value of pp[i] if pp[i] is positive and the value 0 if pp[i] is negative.