It is the first time he has spoken publicly since his ruling AK Party lost its parliamentary majority on 7 June.
Speaking in the capital Ankara, he said all sides must respect the election outcome "as the will of the people".
The AKP is now likely to try to form a coalition, but no party has indicated it is willing to join forces with it.
Breaking his silence at a graduation ceremony for international students, Mr Erdogan warned that history would judge anyone who left Turkey in political limbo.
"We cannot leave Turkey without a government, without a head," he said, adding that he hoped political parties would "prefer solution rather than crisis".
He said he would do his part in finding a solution and that nobody should doubt he will carry out his duties within the constitution.
The AKP secured 41% of the vote in Sunday's election, a sharp drop compared to the 2011 vote.
It has 45 days after the final official election results are declared to form a government - but that declaration is yet to happen.