Is it possible to provide my source code under CC0 on a GitHub repository that satisfies the following properties?

  • It uses Apache 2.0 library.
  • There is no source code or binary of the library in the repository.
  • I provide only code. It means I don't release a built binary.

For example, should I add a license which is stronger than Apache 2.0 and the copy of the library license to the repository that has only the following C code?

#include <opencv2/opencv.hpp>
#include <iostream>
int main() {
    std::cout << CV_VERSION << std::endl;
    return 0;

You can find keywords of OpenCV but can't find any source code of OpenCV. Are keywords also copyrighted? Is it regarded as a derivative work if it has other reference sentence like include or import?

1 Answer 1


It should be OK to publish your source code under any license or other instrument you want, including a CC-0 public domain dedication.

Open-Source licenses are primarily copyright-based, not contract-based. Thus, they can only apply to the original creative work, and any derivative works. There is a good argument that if software code references some library but does not include any parts of the library in any form, then the code isn't derived from the library in the sense of copyright law. But there's a good debate to be had here, especially in an U.S. context since the Google v Oracle dispute about API copyrightability.

When the library is Apache-2.0 licensed, then any of this doesn't matter though.

  • Apache-2.0 explicitly does not affect your code.
  • Even if it would apply, you would be largely free to do what you want.

The Apache-2.0 license defines what it considers to be a “derivative work” that would have to comply with the license conditions. But part of the definition is the following:

For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.

Your source code is completely separable from the Apache-covered library. It does not itself include any parts of the library (and only instructions to include parts during compilation). Your source code links to the library, and for this purpose naming parts of that library is necessary.

So, your source code is not affected by Apache-2.0, and you can license it however you want.

But let's consider what would happen if this provision didn't exist, and if your software did qualify as a derivative work of the Apache-covered library. For example, this might happen if you modify the library, or if you statically link it into a binary with your code.

Then, we would have to consider the license conditions in Section 4 of the license: we have to give users a copy of the license, give prominent notice of changes, keep intact all legal notices in the source code, and must give users access to the NOTICE file, if it exists.

But none of these conditions require you to license the derivative work as a whole in any particular way – unlike copyleft licenses like the GPL family.

You wouldn't be able to publish the derivative work as a whole under CC-0. Only the copyright holder can do that, and you are not the copyright holder for the Apache-covered parts. But you would be free to publish the parts that you wrote under CC-0. The result would be a software where some parts are CC-0 / public domain, with other parts being covered by Apache-2.0. This is actually a fairly common combination, especially on Android, where the public domain SQLite database engine is frequently used, with many other libraries using Apache-2.0.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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