vcpkg
vcpkg copied to clipboard
[cpp-base64] base64.cpp linker error
Describe the bug
Why do I get a linker error with the base64.cpp
file of this library? With other libraries I don't need to manually add a *.cpp
file to my project. A workaround is Add
-> Existing Item...
in Visual Studio.
Environment
- OS: Windows 11 Pro
- Compiler: Microsoft (R) C/C++ Optimizing Compiler Version 19.32.31332 for x64
To Reproduce Steps to reproduce the behavior:
-
vcpkg install cpp-base64:x64-windows
- Add
#include <cpp-base64/base64.h>
to the top of a source file and callbase64_encode()
somewhere in your code. - Compile and observe the linker error occurring:
LNK2019 unresolved external symbol "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl base64_encode(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,bool)" (?base64_encode@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV12@_N@Z) referenced in function [...]
Expected behavior Including the header and compiling will work with no further action required by the developer just like how almost all other ports behave.