Andrew is spot on, and I'll elaborate (copiously) for those who are interested.
Generally one can sell any software one writes assuming one hasn't stolen anything which makes up that software. For example, let's say I work at a software company and we're writing a graphics driver. I think it's neat and want to incorporate it into my own game. In doing so, I would be stealing my company's property. Forget about the game I'm writing - I could go to jail!
The LGPL states that non-derivative works can be close-source (i.e. proprietary) if one chooses, but one must dynamically link to the library. Static linking requires one to open their source code.
The GPL grants the rights of "the free software definition". That definition provides language addressing "software freedom". Free software is defined to mean the recipient has the freedom to:
- run the program (for any purpose)
- study how the program works (and be able to adapt it to one's needs
- redistribute copies
- improve the program (and be able to redistribute one's program)
Access to source code is a pre-condition for 2 and 4.
Once condition of the GPL states that any product that uses GPL'ed code must have that freedom. If I write a piece of GPL'ed software (library or otherwise) and you want to use it in your project, then by all means do so. Your project must, however, be GPL as well (which, as stated above, be open source). The license indicates you must document all the authors whose code you've used in your project (giving credit where credit is due).
You can even sell GPL software (freedom 3). Red Hat, after all sells Enterprise Linux which is practically all GPL code from the GNU project. But do notice, dear reader, that they provide all the source RPMs...
Using the GCC to create code (gcc, g++, g77, etc) does not imply your project be open source. The glibc, for example, is LGPL and, as such, linking to it dynamically allows you to close your source. (This is some tricksy shit, yes?)
Close your source if you want to. You must open it, however, if you use code (or derivatives) from other sources that are GPL'ed.
-capt jack
(No, I am not a lawyer.)