"This too is a grievous evil: As a man comes, so he departs, and what does he gain, since he toils for the wind? All his days he eats in darkness, with great frustration, affliction and anger." NIV translation
Solomon describes the fact that we all want to have a purpose in life. Those that chase after the things of this world do not understand (are in darkness) that they cannot take them with them when they die. Others get frustrated and hopeless when they cannot see the fact that God loves us so much that He wants us to accept Him and to follow His plan for our lives.
"Then I realized that it is good and proper for a man to eat and drink, and to find satisfaction in his toilsome labor under the sun during the few days of life God has given him - for this is his lot. Moreover, when God gives any man wealth and possessions, and enables him to enjoy them, to accept his lot and be happy in his work - this is a gift of God. He seldom reflects on the days of his life, because God keeps him occupied with gladness of heart." NIV translation
We see from this passage that our wealth or our job is not the important thing. Solomon found that what is important is realizing that whatever we have is a gift from God. If we stay focused on the fact that every day and everything is a gift from God, we will love Him and be glad.