In general, I avoid reinventing the wheel if the functionality I desire, or something approximating it, exists in the standard library of the language I use.
However, if I have to incorporate third party libraries, it's a judgment call depending on how widely used and esteemed the library is. I mean, are we talking about Boost or Bob's Kick-ass String-Parsing Tools 1.0?
Even if the library is generally well-known and highly-esteemed throughout the industry, it's still a third-party dependency. Programmers generally place significant emphasis on the virtues of code reuse, while often glossing over the danger of dependencies. A project with too many third-party dependencies is likely to fall apart in the long run as it slowly devolves into a maintenance nightmare.
As for libraries which are relatively unknown, (e.g. the latest upload on SourceForge) these are extremely risky dependencies, and I would generally recommend avoiding these in production code, unless you are familiar enough with the source code to maintain them yourself.
So it's really all a balancing act. But the point is that just blindly saying "Code reuse good! Reinventing wheel bad!" is a dangerous attitude. The benefits of leveraging third-party code must be weighed against the disadvantages of introducing dependencies.
The good thing about reinventing the wheel is that you can get a round one.