0

I have an operator<< declaration in the header, and the definition in the cpp. If I compile a static library, then when I would like to use my function the linker can not find the definition. I have a linker error, LNK2019. I am using VS22. If the definition and declaration are at the same place, nothing is wrong.

Thanks for your help!

  • 2
    Have you told the linker to include the library & where it is? – Avi Berger Oct 04 '22 at 21:16
  • Does this answer your question? [What is an undefined reference/unresolved external symbol error and how do I fix it?](https://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix) – Avi Berger Oct 04 '22 at 21:17
  • Just that operator, or is it *everything* in the static lib that seems to be missing at link-time? If the latter, you're probably not linking the library correctly. If the former (just that operator), it's probably an implementation problem in either the header or source, neither of which we can assess without actually *seeing* the code. – WhozCraig Oct 04 '22 at 21:19

0 Answers0