In order to combine two programs (or substantial parts of them) into a larger
work, you need to have permission to use both programs in this way. If the two
programs' licenses permit this, they are compatible. If there is no way to
satisfy both licenses at once, they are incompatible.

For some licenses, the way in which the combination is made may affect
whether they are compatible—for instance, they may allow linking two modules
together, but not allow merging their code into one module.

If you just want to install two separate programs in the same system, it is
not necessary that their licenses be compatible, because this does not combine
them into a larger work.

It means that the other license and the GNU GPL are compatible; you can
combine code released under the other license with code released under the GNU
GPL in one larger program.

All GNU GPL versions permit such combinations privately; they also permit
distribution of such combinations provided the combination is released under the
same GNU GPL version. The other license is compatible with the GPL if it permits
this too.

GPLv3 is compatible with more licenses than GPLv2: it allows you to make
combinations with code that has specific kinds of additional requirements that
are not in GPLv3 itself. Section 7 has more information about this, including
the list of additional requirements that are permitted.

（3）自由软件可以使用非自由的库吗？是可以的，但是在自由的环境中，你的程序将不能充分利用起来。而且，这完全在自由世界的界限之外。

Can I write free software that uses non-free libraries?
(#FSWithNFLibs)

If you do this, your program won't be fully usable in a free environment. If
your program depends on a non-free library to do a certain job, it cannot do
that job in the Free World. If it depends on a non-free library to run at all,
it cannot be part of a free operating system such as GNU; it is entirely off
limits to the Free World.

So please consider: can you find a way to get the job done without using this
library? Can you write a free replacement for that library?

If the program is already written using the non-free library, perhaps it is
too late to change the decision. You may as well release the program as it
stands, rather than not release it. But please mention in the README that the
need for the non-free library is a drawback, and suggest the task of changing
the program so that it does the same job without the non-free library. Please
suggest that anyone who thinks of doing substantial further work on the program
first free it from dependence on the non-free library.

Both versions of the GPL have an exception to their copyleft, commonly called
the system library exception. If the GPL-incompatible libraries you want to use
meet the criteria for a system library, then you don't have to do anything
special to use them; the requirement to distribute source code for the whole
program does not include those libraries, even if you distribute a linked
executable containing them.

The criteria for what counts as a "system library" vary between different
versions of the GPL. GPLv3 explicitly defines "System Libraries" in section 1,
to exclude it from the definition of "Corresponding Source." GPLv2 deals with
this issue slightly differently, near the end of section 3.

（5）如果我在GPL软件中使用了GPL不兼容的库，那么会有什么法律问题呢？

What legal issues come up if I use GPL-incompatible
libraries with GPL software? (#GPLIncompatibleLibs)

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.

When other people modify the program, they do not have to make the same
exception for their code—it is their choice whether to do so.

If you're using GPLv3, you can accomplish this goal by granting an additional
permission under section 7. The following license notice will do that. You must
replace all the text in brackets with text that is appropriate for your program.
If not everybody can distribute source for the libraries you intend to link
with, you should remove the text in braces; otherwise, just remove the braces
themselves.

Copyright (C) [years][name of copyright holder]

This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.

This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.

You should have received a copy of the GNU General Public License along with
this program; if not, see <http://www.gnu.org/licenses>.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it
with [name of library] (or a modified version of that library),
containing parts covered by the terms of [name of library's license],
the licensors of this Program grant you additional permission to convey the
resulting work. {Corresponding Source for a non-source form of such a
combination shall include the source code for the parts of [name of
library] used as well as that of the covered work.}

If you're using GPLv2, you can provide your own exception to the license's
terms. The following license notice will do that. Again, you must replace all
the text in brackets with text that is appropriate for your program. If not
everybody can distribute source for the libraries you intend to link with, you
should remove the text in braces; otherwise, just remove the braces
themselves.

Copyright (C) [years][name of copyright holder]

This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later
version.

This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.

You should have received a copy of the GNU General Public License along with
this program; if not, see <http://www.gnu.org/licenses>.

Linking [name of your program] statically or dynamically with
other modules is making a combined work based on [name of your
program]. Thus, the terms and conditions of the GNU General Public License
cover the whole combination.

In addition, as a special exception, the copyright holders of [name of
your program] give you permission to combine [name of your
program] with free software programs or libraries that are released under
the GNU LGPL and with code included in the standard release of [name of
library] under the [name of library's license] (or modified
versions of such code, with unchanged license). You may copy and distribute such
a system following the terms of the GNU GPL for [name of your
program] and the licenses of the other code concerned{, provided that you
include the source code of that other code when and as the GNU GPL requires
distribution of source code}.

Note that people who make modified versions of [name of your
program] are not obligated to grant this special exception for their
modified versions; it is their choice whether to do so. The GNU General Public
License gives permission to release a modified version without this exception;
this exception also makes it possible to release a modified version which
carries forward this exception.

（6）版权所有者，可以平行地在多 许可证下发布自己的程序。

常见的做法是双许可证，一个GPL许可证进行公开并保护，另一个作为商业许可证。

I heard that someone got a copy of a GPL'ed program
under another license. Is this possible? (#HeardOtherLicense)

The GNU GPL does not give users permission to attach other licenses to the
program. But the copyright holder for a program can release it under several
different licenses in parallel. One of them may be the GNU GPL.

The license that comes in your copy, assuming it was put in by the copyright
holder and that you got the copy legitimately, is the license that applies to
your copy.

I would like to release a program I wrote under the
GNU GPL, but I would like to use the same code in non-free programs. (#ReleaseUnderGPLAndNF)

To release a non-free program is always ethically tainted, but legally there
is no obstacle to your doing this. If you are the copyright holder for the code,
you can release it under various different non-exclusive licenses at various
times.

（8）将程序以GPL发布的开发者，以后可以许可另一方”独家使用“吗？不行，因为公众在GPL下已经有使用程序的权利了，而这个权利无法撤回。

Can the developer of a program who distributed it
under the GPL later license it to another party for exclusive use? (#CanDeveloperThirdParty)

No, because the public already has the right to use the program under the
GPL, and this right cannot be withdrawn.

Can I use GPL-covered editors such as GNU Emacs to
develop non-free programs? Can I use GPL-covered tools such as GCC to compile
them? (#CanIUseGPLToolsForNF)

Yes, because the copyright on the editors and tools does not cover the code
you write. Using them does not place any restrictions, legally, on the license
you use for your code.

Some programs copy parts of themselves into the output for technical
reasons—for example, Bison copies a standard parser program into its output
file. In such cases, the copied text in the output is covered by the same
license that covers it in the source code. Meanwhile, the part of the output
which is derived from the program's input inherits the copyright status of the
input.

As it happens, Bison can also be used to develop non-free programs. This is
because we decided to explicitly permit the use of the Bison standard parser
program in Bison output files without restriction. We made the decision because
there were other tools comparable to Bison which already permitted use for
non-free programs.

Does the LGPL have different requirements for
statically vs dynamically linked modules with a covered work? (#LGPLStaticVsDynamic)

For the purpose of complying with the LGPL (any extant version: v2, v2.1 or
v3):

(1) If you statically link against an LGPL'd library, you must also provide
your application in an object (not necessarily source) format, so that a user
has the opportunity to modify the library and relink the application.

(2) If you dynamically link against an LGPL'd library already present on
the user's computer, you need not convey the library's source. On the other
hand, if you yourself convey the executable LGPL'd library along with your
application, whether linked with statically or dynamically, you must also convey
the library's sources, in one of the ways for which the LGPL provides.

If I add a module to a GPL-covered program, do I have to
use the GPL as the license for my module? (#GPLModuleLicense)

The GPL says that the whole combined program has to be released under the
GPL. So your module has to be available for use under the GPL.

But you can give additional permission for the use of your code. You can, if
you wish, release your program under a license which is more lax than the GPL
but compatible with the GPL. The license
list page gives a partial list of GPL-compatible licenses.

（13）如果一个库是基于GPL发布的，那么是不是任何使用到该库的软件，都必须是GPL许可的，或者GPL兼容的许可证？答案是肯定的。

If a library is released under the GPL (not the LGPL),
does that mean that any software which uses it has to be under the GPL or a
GPL-compatible license? (#IfLibraryIsGPL)

If a programming language interpreter is released
under the GPL, does that mean programs written to be interpreted by it must be
under GPL-compatible licenses? (#IfInterpreterIsGPL)

When the interpreter just interprets a language, the answer is no. The
interpreted program, to the interpreter, is just data; a free software license
like the GPL, based on copyright law, cannot limit what data you use the
interpreter on. You can run it on any data (interpreted program), any way you
like, and there are no requirements about licensing that data to anyone.

However, when the interpreter is extended to provide “bindings” to other
facilities (often, but not necessarily, libraries), the interpreted program is
effectively linked to the facilities it uses through these bindings. So if these
facilities are released under the GPL, the interpreted program that uses them
must be released in a GPL-compatible way. The JNI or Java Native Interface is an
example of such a binding mechanism; libraries that are accessed in this way are
linked dynamically with the Java programs that call them. These libraries are
also linked with the interpreter. If the interpreter is linked statically with
these libraries, or if it is designed to link
dynamically with these specific libraries, then it too needs to be released
in a GPL-compatible way.

Another similar and very common case is to provide libraries with the
interpreter which are themselves interpreted. For instance, Perl comes with many
Perl modules, and a Java implementation comes with many Java classes. These
libraries and the programs that call them are always dynamically linked
together.

A consequence is that if you choose to use GPL'd Perl modules or Java classes
in your program, you must release the program in a GPL-compatible way,
regardless of the license used in the Perl or Java interpreter that the combined
Perl or Java program will run on.

I'm writing a Windows application with Microsoft
Visual C++ (or Visual Basic) and I will be releasing it under the GPL. Is
dynamically linking my program with the Visual C++ (or Visual Basic) runtime
library permitted under the GPL? (#WindowsRuntimeAndGPL)

You may link your program to these libraries, and distribute the compiled
program to others. When you do this, the runtime libraries are “System
Libraries” as GPLv3 defines them. That means that you don't need to worry about
including their source code with the program's Corresponding Source. GPLv2
provides a similar exception in section 3.

You may not distribute these libraries in compiled DLL form with the program.
To prevent unscrupulous distributors from trying to use the System Library
exception as a loophole, the GPL says that libraries can only qualify as System
Libraries as long as they're not distributed with the program itself. If you
distribute the DLLs with the program, they won't be eligible for this exception
anymore; then the only way to comply with the GPL would be to provide their
source code, which you are unable to do.

It is possible to write free programs that only run on Windows, but it is not
a good idea. These programs would be “trapped” by Windows, and therefore
contribute zero to the Free World.

（16）如果一个程序以GPL插件形式发布，那么插件需要什么许可证？

如果程序是以fork然后exev的形式使用插件，那么是以新建进程的形式使用，则不会感染GPL。

如果程序动态链接插件，那么就会感染GPL。

If a program released under the GPL uses plug-ins, what are
the requirements for the licenses of a plug-in? (#GPLAndPlugins)

It depends on how the program invokes its plug-ins. If the program uses fork
and exec to invoke plug-ins, then the plug-ins are separate programs, so the
license for the main program makes no requirements for them.

If the program dynamically links plug-ins, and they make function calls to
each other and share data structures, we believe they form a single program,
which must be treated as an extension of both the main program and the plug-ins.
This means the plug-ins must be released under the GPL or a GPL-compatible free
software license, and that the terms of the GPL must be followed when those
plug-ins are distributed.

If the program dynamically links plug-ins, but the communication between them
is limited to invoking the ‘main’ function of the plug-in with some options and
waiting for it to return, that is a borderline case.