I want to use code written by others and published under gpl2 license, on my software project. I was wondering what is the way to go about it. I hope to publish my software using the gpl3 license. I am very new to this field, so please let me know if I missed any crucial information.
While the GPLv2 and GPLv3 are very similar, they have clauses that make them incompatible. If you combine GPLv2 covered code with GPLv3 covered code, you cannot share the result.
Some GPLv2 software doesn't limit you to the GPLv2, but also allows any later version of the GPL. In that case, you could use that code as if it were GPLv3-licensed.
Without such an upgrade clause, your choices are:
- to not use the code
- to ask the copyright holders to change the license to one they can use (but note that license changes can take a ton of effort because all contributors must agree)
- to wrap the GPLv2 code you want to use in a standalone program that you can launch from your code. For example, wrap the GPLv2 code with a REST API or with a command line interface. It is allowed to distribute programs with different licenses side by side, you just can't always combine them into a single program.