I'm using gcc
on WSL
to compile a C++
Linux
project. I wanted to use the base64
encode/decode library so I installed it with vcpkg
. I'm including the library's functions via #include <cpp-base64/base64.h>
. However, this causes a linker error:
undefined reference to `base64_encode[abi:cxx11](unsigned char const*, unsigned int)'
Upon investigating the include
directory, I see nothing unusual:
/bin/vcpkg/installed/x64-linux/include/cpp-base64$ lsbase64.cpp base64.h
As a test I decided to copy the base64.cpp
into my source code directory directly and it linked correctly. Why is this happening? Shouldn't the linker pick up the base64.cpp
implementation from the include
directory without any problems?