vcpkg icon indicating copy to clipboard operation
vcpkg copied to clipboard

[cpp-base64] base64.cpp linker error

Open BullyWiiPlaza opened this issue 2 years ago • 0 comments

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:

  1. vcpkg install cpp-base64:x64-windows
  2. Add #include <cpp-base64/base64.h> to the top of a source file and call base64_encode() somewhere in your code.
  3. 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.

BullyWiiPlaza avatar Aug 09 '22 12:08 BullyWiiPlaza