Your original code is never a derivative work. You retain copyright to the code you wrote yourself, even if it's combined with GPL later. GPL even contains this interesting clause:
> You are not required to accept this License, since you have not signed it.
So to answer your question: no, unless you've copied bits of GPL library into your code (or similar that would be judged as a copyright violation).
There's also a crappy situation of Oracle vs Google that made APIs copyrightable, so now it's not entirely clear if your code + your rewrite of library is still yours if it uses an API of the GPL library.
> Your original code is never a derivative work[...]
> > You are not required to accept this License, since you have not signed it.
> So to answer your question: no, unless you've copied bits of GPL library into your code (or similar that would be judged as a copyright violation).
Actually that clears a lot up for me, and I'd have considered myself reasonably knowledgeable when it comes to copyright in general; I think I had a few conflicting ideas about what it means to be an original work. Thank you.
> You are not required to accept this License, since you have not signed it.
So to answer your question: no, unless you've copied bits of GPL library into your code (or similar that would be judged as a copyright violation).
There's also a crappy situation of Oracle vs Google that made APIs copyrightable, so now it's not entirely clear if your code + your rewrite of library is still yours if it uses an API of the GPL library.