arun11299 / cpp-jwt

JSON Web Token library for C++

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

msvc 2019 link error

LukeMauldin opened this issue · comments

I am using version 1.3 of the library with MSVC 2019 with cmake. I have a function that reads a token and that function compiles, links, and runs correctly. I have a similar function that creates a new token but that function fails to link with the error below:

 cmd.exe /C "cd . && "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E vs_link_exe --intdir=XXX\tests\CMakeFiles\XXX.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100183~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100183~1.0\x64\mt.exe --manifests  -- C:\PROGRA~2\MICROS~4\2019\PROFES~1\VC\Tools\MSVC\1428~1.293\bin\Hostx64\x64\link.exe /nologo XXX\tests\CMakeFiles\XXX.dir\bytes_test.cpp.obj XXX\tests\CMakeFiles\XXX.dir\cache_test.cpp.obj XXX\tests\CMakeFiles\XXX.dir\config_test.cpp.obj XXX\tests\CMakeFiles\XXX.dir\crypto_test.cpp.obj XXX\tests\CMakeFiles\XXX.dir\consul_test.cpp.obj XXX\tests\CMakeFiles\XXX.dir\employeedata_test.cpp.obj XXX\tests\CMakeFiles\XXX.dir\exception_test.cpp.obj XXX\tests\CMakeFiles\XXX.dir\globalsetup_test.cpp.obj XXX\tests\CMakeFiles\XXX.dir\jwtauth_test.cpp.obj XXX\tests\CMakeFiles\XXX.dir\XXXtest.cpp.obj XXX\tests\CMakeFiles\XXX.dir\userctx_test.cpp.obj XXX\tests\CMakeFiles\XXX.dir\webutil_test.cpp.obj XXX\tests\CMakeFiles\XXX.dir\zlib_test.cpp.obj  /out:bin\XXX.exe /implib:lib\XXX.lib /pdb:bin\XXX.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console -LIBPATH:XXX\build\x64-Debug\lib   -LIBPATH:XXXt\build\x64-Debug\lib64 lib\XXX.lib  gtestd.lib  gmockd.lib  gtest_maind.lib  gmock_maind.lib  bsoncxx.lib  mongocxx.lib  fmtd.lib  spdlogd.lib  libcrypto.lib  zlibd.lib  libssl.lib  libprotobuf-lited.lib  libprotobufd.lib  bcrypt.lib  kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cmd.exe /C "cd /D XXXt\build\x64-Debug\XXX\tests && "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -D TEST_TARGET=XXX -D TEST_EXECUTABLE=XXX/x64-Debug/bin/XXX.exe -D TEST_EXECUTOR= -D TEST_WORKING_DIR=XXX/x64-Debug/XXX/tests -D TEST_EXTRA_ARGS= -D TEST_PROPERTIES=VS_DEBUGGER_WORKING_DIRECTORY -D TEST_PREFIX= -D TEST_SUFFIX= -D NO_PRETTY_TYPES=FALSE -D NO_PRETTY_VALUES=FALSE -D TEST_LIST=XXX_TESTS -D CTEST_FILE=C:/XXX/tests/XXX[1]_tests.cmake -D TEST_DISCOVERY_TIMEOUT=5 -D TEST_XML_OUTPUT_DIR= -P "C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.18/Modules/GoogleTestAddTests.cmake"""
  LINK Pass 1: command "C:\PROGRA~2\MICROS~4\2019\PROFES~1\VC\Tools\MSVC\1428~1.293\bin\Hostx64\x64\link.exe /nologo XXX\tests\CMakeFiles\XXX.dir\bytes_test.cpp.obj XXX\tests\CMakeFiles\XXX.dir\cache_test.cpp.obj XXX\tests\CMakeFiles\XXX.dir\config_test.cpp.obj XXX\tests\CMakeFiles\XXX.dir\crypto_test.cpp.obj XXX\tests\CMakeFiles\XXX.dir\consul_test.cpp.obj XXX\tests\CMakeFiles\XXX.dir\employeedata_test.cpp.obj XXX\tests\CMakeFiles\XXX.dir\exception_test.cpp.obj XXX\tests\CMakeFiles\XXX.dir\globalsetup_test.cpp.obj XXX\tests\CMakeFiles\XXX.dir\jwtauth_test.cpp.obj XXX\tests\CMakeFiles\XXX.dir\XXXtest.cpp.obj XXX\tests\CMakeFiles\XXX.dir\userctx_test.cpp.obj XXX\tests\CMakeFiles\XXX.dir\webutil_test.cpp.obj XXX\tests\CMakeFiles\XXX.dir\zlib_test.cpp.obj /out:bin\XXX.exe /implib:lib\XXX.lib /pdb:bin\XXX.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console -LIBPATH:XXX\build\x64-Debug\lib -LIBPATH:XXX\build\x64-Debug\lib64 lib\XXX.lib gtestd.lib gmockd.lib gtest_maind.lib gmock_maind.lib bsoncxx.lib mongocxx.lib fmtd.lib spdlogd.lib libcrypto.lib zlibd.lib libssl.lib libprotobuf-lited.lib libprotobufd.lib bcrypt.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:XXX\tests\CMakeFiles\XXX.dir/intermediate.manifest XXX\tests\CMakeFiles\XXX.dir/manifest.res" failed (exit code 1120) with the following output:
XXX\build\x64-Debug\XXX.lib(jwtauth.cpp.obj) : error LNK2019: unresolved external symbol "private: void __cdecl jwt::jwt_object::set_parameters<struct jwt::params::detail::payload_param<class std::unordered_map<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct std::hash<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,struct std::equal_to<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const ,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > > > const &>(struct jwt::params::detail::payload_param<class std::unordered_map<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct std::hash<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,struct std::equal_to<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const ,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > > > const &)" (??$set_parameters@AEBU?$payload_param@V?$unordered_map@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@U?$hash@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@U?$equal_to@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@V?$allocator@U?$pair@$$CBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@@std@@@2@@std@@@detail@params@jwt@@@jwt_object@jwt@@AEAAXAEBU?$payload_param@V?$unordered_map@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@U?$hash@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@U?$equal_to@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@V?$allocator@U?$pair@$$CBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@@std@@@2@@std@@@detail@params@1@@Z) referenced in function "private: void __cdecl jwt::jwt_object::set_parameters<struct jwt::params::detail::payload_param<class std::unordered_map<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct std::hash<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,struct std::equal_to<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const ,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > > > const &>(struct jwt::params::detail::secret_param,struct jwt::params::detail::payload_param<class std::unordered_map<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct std::hash<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,struct std::equal_to<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const ,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > > > const &)" (??$set_parameters@AEBU?$payload_param@V?$unordered_map@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@U?$hash@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@U?$equal_to@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@V?$allocator@U?$pair@$$CBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@@std@@@2@@std@@@detail@params@jwt@@@jwt_object@jwt@@AEAAXUsecret_param@detail@params@1@AEBU?$payload_param@V?$unordered_map@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@U?$hash@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@U?$equal_to@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@V?$allocator@U?$pair@$$CBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@@std@@@2@@std@@@341@@Z)
XXXX\build\x64-Debug\bin\XXX.exe : fatal error LNK1120: 1 unresolved externals