DISCLAIMER: I am not a lawyer. This answer comes with no warranty at all.
From http://www.gnu.org/licenses/gpl-faq.html:
"
If you want your program to link against a library not covered by the system library exception, you need to provide permission to do that. Below are two example license notices that you can use to do that; one for GPLv3, and the other for GPLv2. In either case, you should put this text in each file to which you are granting this permission.
Only the copyright holders for the program can legally release their software under these terms. If you wrote the whole program yourself, then assuming your employer or school does not claim the copyright, you are the copyright holder—so you can authorize the exception. But if you want to use parts of other GPL-covered programs by other authors in your code, you cannot authorize the exception for them. You have to get the approval of the copyright holders of those programs.
"
There are an example license to include in each file after that. If you use someone else GPL code (a library, for example), you cannot do anything without them changing their license.