Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I'm releasing a program, I like to license it under the GPL or LGPL. I also want to stay compliant with that license. I'm not good at reading legal documents, and the GPL3 is about 10 pages long. How do I avoid GPL violations in my code?

share|improve this question
up vote 8 down vote accepted

Did you write the code?

Then the GPL is working for you - you don't need to do anything to bide by it, the people you distribute the code to are bound by it. Remember the GPL doesn't apply to you for your own code - you are still free to do anything else you want with it. You can even sell it alongside the GPL version.

If you used other GPL code in your app then you just abide by the same license. You include the same gpl.txt file and make your source available (put it github etc)

edit: to add luis' point. If you accept contributions from anyone else then the GPL would apply to you - unless you had them give you extra permissions

share|improve this answer
As a special note, as soon as you accept GPLed code from anyone else into your own GPL project, then the last paragraph applies too - even if you started the project and did most of the work. – luiscubal Nov 3 '12 at 23:01

Does your code use any tools, APIs or other code that you didn't write? What are the licenses of those bits of code? Are they GPL compatible? You understand, of course, that using the GPL means that no-one can distribute closed-source code with your code because doing so forces that code to become GPL.

Did anyone else contribute to your code? Do you have contributors agreements with them?

share|improve this answer

If you wrote the entire code, then you own it, and you can release it under GPL- the question "How do I avoid GPL violations in my code" does not really apply here.

If you used code from other open source projects in your code, you can still release your code under GPL as long as you identify what pieces come from where, and satisfy the license obligations coming from the other open source projects. Check the licenses of the code you have used to see what their obligations are (eg you may have to add their license.txt into your package).

If you used code from non-open source projects in your code, then you need to contact the owners (copyright or license holders) of those proprietary projects and get their permission.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.