You are confusing two things. It is certainly possible for a library to be licensed in such a way that its use is restricted. But this does not depend on the notion of a derived work. Use of the library itself is restricted, independent of what the calling code is used for.
But the GPL explicitly does not do this. Clause 0 says:
Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, [...]
Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds