Related
This is driving me nuts, using MSVC14.1 I am making a library A to be used in another shared library B. It does not matter if the library A is static or shared, I always end up with 3 unresolved external symbols as such :
[build] GroomDeformer.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class avPoly::PolyMesh __cdecl avPoly::PolyMesh::create(class std::vector<struct glm::vec<3,float,0>,class std::allocator<struct glm::vec<3,float,0> > > const &,class std::vector<unsigned int,class std::allocator<unsigned int> > const &,class std::vector<unsigned __int64,class std::allocator<unsigned __int64> > const &)" (__imp_?create#PolyMesh#avPoly##SA?AV12#AEBV?$vector#U?$vec#$02M$0A##glm##V?$allocator#U?$vec#$02M$0A##glm###std###std##AEBV?$vector#IV?$allocator#I#std###4#AEBV?$vector#_KV?$allocator#_K#std###4##Z) referenced in function "public: void __cdecl avGroomCore::GroomDeformer::ConstructMesh(class std::vector<struct glm::vec<3,float,0>,class std::allocator<struct glm::vec<3,float,0> > > const &,class std::vector<unsigned __int64,class std::allocator<unsigned __int64> > const &,class std::vector<unsigned int,class std::allocator<unsigned int> > const &)" (?ConstructMesh#GroomDeformer#avGroomCore##QEAAXAEBV?$vector#U?$vec#$02M$0A##glm##V?$allocator#U?$vec#$02M$0A##glm###std###std##AEBV?$vector#_KV?$allocator#_K#std###4#AEBV?$vector#IV?$allocator#I#std###4##Z) [C:\Users\tufto\PycharmProjects\avgroom\build\src\core\Core.vcxproj]
[build] GroomDeformer.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class avPoly::FaceLocation __cdecl avPoly::PolyMesh::getClosestLocation(struct glm::vec<3,float,0> const &)" (__imp_?getClosestLocation#PolyMesh#avPoly##QEAA?AVFaceLocation#2#AEBU?$vec#$02M$0A##glm###Z) referenced in function "public: void __cdecl avGroomCore::GroomDeformer::DeformGroom(void)" (?DeformGroom#GroomDeformer#avGroomCore##QEAAXXZ) [C:\Users\tufto\PycharmProjects\avgroom\build\src\core\Core.vcxproj]
[build] GroomDeformer.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: struct glm::vec<3,float,0> __cdecl avPoly::PolyMesh::getAttributeValueFromLocation(class avPoly::FaceLocation const &,class avPoly::Attribute<struct glm::vec<3,float,0> > &)" (__imp_?getAttributeValueFromLocation#PolyMesh#avPoly##QEAA?AU?$vec#$02M$0A##glm##AEBVFaceLocation#2#AEAV?$Attribute#U?$vec#$02M$0A##glm###2##Z) referenced in function "public: void __cdecl avGroomCore::GroomDeformer::DeformGroom(void)" (?DeformGroom#GroomDeformer#avGroomCore##QEAAXXZ) [C:\Users\tufto\PycharmProjects\avgroom\build\src\core\Core.vcxproj]
I do not know what to do at this stage. I looked into the symbols from dumpbin and i do get the signatures, for example :
__imp_?create#PolyMesh#avPoly##SA?AV12#AEBV?$vector#U?$tvec3#M$0A##glm##V?$allocator#U?$tvec3#M$0A##glm###std###std##AEBV?$vector#IV?$allocator#I#std###4#AEBV?$vector#_KV?$allocator#_K#std###4##Z
The only thing i can notice is this has "tvec3" instead of just "vec" in the error signature. I think this refers to a typedef i have to GLM for library A such as :
typedef glm::vec3 Vector3;
typedef std::vector<Vector3> Vector3Array;
Any ideas or guidelines on how i could debug this ? I've tried all I can think off and can't put my finger on it. The worst part is that in the library A project i have another mini executable to test it that links just fine... (all using CMake). Both CMake configs are the same.
Here are the method signatures in the header file for these :
AVPOLYLIB_API
static PolyMesh create(Vector3Array const &positions, UIntArray const &faceVertexCounts, IndexArray const &faceVertexIndices);
AVPOLYLIB_API
FaceLocation getClosestLocation(Vector3 const &point);
AVPOLYLIB_API
Vector3 getAttributeValueFromLocation(FaceLocation const & location, Attribute<Vector3> &attribute);
DLL Export is done as follows :
#ifdef AVPOLYLIB_STATIC
#define AVPOLYLIB_API
#else
#ifdef AVPOLYLIB_EXPORTS
#define AVPOLYLIB_API __declspec(dllexport)
#else
#define AVPOLYLIB_API __declspec(dllimport)
#endif
#endif
The types used in these methods are declared like this (inside the library namespace):
class FaceLocation {
public:
Index triangleId;
Vector3 barycentricCoordinates;
};
typedef std::vector<Vector3> Vector3Array;
typedef std::vector<Index> IndexArray;
typedef std::vector<unsigned int> UIntArray;
Solved it ! It was silly : there was a problem with the glm headers as they where submodules in both libraries but for some reason where not version matching. So i did have a wrong signature in the exported symbols. Using the headers in the same folder solved the issue.
When including any managed class to my managed unit test the compile spits out these errors:
1>UnitTest.obj : error LNK2020: unresolved token (0A000360) "extern "C" int __cdecl _CrtDbgReportW(int,wchar_t const *,int,wchar_t const *,wchar_t const *,...)" (?_CrtDbgReportW##$$J0YAHHPB_WH00ZZ)
1>UnitTest.obj : error LNK2020: unresolved token (0A000361) "extern "C" int __cdecl _CrtDbgReportW(int,wchar_t const *,int,wchar_t const *,wchar_t const *,...)" (?_CrtDbgReportW##$$J0YAHHPB_WH00ZZ)
1>UnitTest.obj : error LNK2028: unresolved token (0A0003E6) "extern "C" void __cdecl _invalid_parameter(wchar_t const *,wchar_t const *,wchar_t const *,unsigned int,unsigned int)" (?_invalid_parameter##$$J0YAXPB_W00II#Z) referenced in function "public: void __thiscall std::_Iterator_base12::_Orphan_me(void)" (?_Orphan_me#_Iterator_base12#std##$$FQAEXXZ)
1>UnitTest.obj : error LNK2019: unresolved external symbol "extern "C" void __cdecl _invalid_parameter(wchar_t const *,wchar_t const *,wchar_t const *,unsigned int,unsigned int)" (?_invalid_parameter##$$J0YAXPB_W00II#Z) referenced in function "public: void __thiscall std::_Iterator_base12::_Orphan_me(void)" (?_Orphan_me#_Iterator_base12#std##$$FQAEXXZ)
1>UnitTest.obj : error LNK2001: unresolved external symbol "extern "C" int __cdecl _CrtDbgReportW(int,wchar_t const *,int,wchar_t const *,wchar_t const *,...)" (?_CrtDbgReportW##$$J0YAHHPB_WH00ZZ)
I am using a clr project as well as including a managed class. Removing the include allows the test to compile.
To solve this issue you must remove
"_DEBUG"
from the test project in
[TestProject] -> Properties -> C/C++ --> Preprocessor --> Preprocessor
Definitions
Alternitively you can change
"_DEBUG" to "NDEBUG"
I was reworking a project to use GLFW in opposed to FreeGLUT, and I think I must've managed to delete something in my linker settings. I'm using GLEW, and while I initially thought I had untethered it somehow, its not giving me an error for all GLEW-related function calls, only a couple. I've checked the changes I made to property files using git, and the only change is replacing freeglut.lib with glfwdll.lib
The error messages:
1>main.obj : error LNK2019: unresolved external symbol __imp__glBlendFunc#8 referenced in function "void __cdecl display(void)" (?display##YAXXZ)
1>main.obj : error LNK2019: unresolved external symbol __imp__glClear#4 referenced in function "void __cdecl display(void)" (?display##YAXXZ)
1>main.obj : error LNK2019: unresolved external symbol __imp__glClearColor#16 referenced in function "void __cdecl display(void)" (?display##YAXXZ)
1>main.obj : error LNK2019: unresolved external symbol __imp__glDepthFunc#4 referenced in function "void __cdecl display(void)" (?display##YAXXZ)
1>main.obj : error LNK2019: unresolved external symbol __imp__glEnable#4 referenced in function "void __cdecl display(void)" (?display##YAXXZ)
1>main.obj : error LNK2019: unresolved external symbol __imp__glViewport#16 referenced in function _main
1>Renderer.obj : error LNK2019: unresolved external symbol __imp__glBindTexture#8 referenced in function "public: void __thiscall Renderer::Render(unsigned int const &,unsigned int const &,struct RenderVariables const &,unsigned int const &,unsigned int const &)" (?Render#Renderer##QAEXABI0ABURenderVariables##00#Z)
1>Sprite.obj : error LNK2001: unresolved external symbol __imp__glBindTexture#8
1>Renderer.obj : error LNK2019: unresolved external symbol __imp__glDrawArrays#12 referenced in function "public: void __thiscall Renderer::Render(unsigned int const &,unsigned int const &,struct RenderVariables const &,unsigned int const &,unsigned int const &)" (?Render#Renderer##QAEXABI0ABURenderVariables##00#Z)
1>Sprite.obj : error LNK2019: unresolved external symbol __imp__glGenTextures#8 referenced in function "public: bool __thiscall Sprite::loadSprite(char *)" (?loadSprite#Sprite##QAE_NPAD#Z)
1>Sprite.obj : error LNK2019: unresolved external symbol __imp__glGetFloatv#8 referenced in function "public: bool __thiscall Sprite::loadSprite(char *)" (?loadSprite#Sprite##QAE_NPAD#Z)
1>Sprite.obj : error LNK2019: unresolved external symbol __imp__glTexImage2D#36 referenced in function "public: bool __thiscall Sprite::loadSprite(char *)" (?loadSprite#Sprite##QAE_NPAD#Z)
1>Sprite.obj : error LNK2019: unresolved external symbol __imp__glTexParameterf#12 referenced in function "public: bool __thiscall Sprite::loadSprite(char *)" (?loadSprite#Sprite##QAE_NPAD#Z)
1>Sprite.obj : error LNK2019: unresolved external symbol __imp__glTexParameteri#12 referenced in function "public: bool __thiscall Sprite::loadSprite(char *)" (?loadSprite#Sprite##QAE_NPAD#Z)
Then, my main() function, which is the only function that ended up changing during the transition:
void main(int argc, char** argv)
{
if (!glfwInit())
{
exit(-1);
}
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_COMPAT_PROFILE);
GLFWwindow* window = glfwCreateWindow(width, height, "Space Invaders", NULL, NULL);
if (window == NULL)
{
std::cout << "Failed to create GLFW window" << std::endl;
glfwTerminate();
endGame(-1);
}
glfwMakeContextCurrent(window);
glViewport(0, 0, width, height);
// A call to glewInit() must be done after GLFW is initialized!
GLenum res = glewInit();
// Check for any errors
if (res != GLEW_OK) {
fprintf(stderr, "Error: '%s'\n", glewGetErrorString(res));
endGame(1);
}
gameState = new GameState();
init();
while (!glfwWindowShouldClose(window))
{
pollInput(window);
display();
glfwSwapBuffers(window);
glfwPollEvents();
}
endGame(0);
}
I've noticed that each of the functions throwing errors have the gl- prefix rather than glew-, do I need to add another library now that I'm not using freeglut? I'm currently only linking glfw and glew.
Ok, I'm not sure how I managed without it before, but I needed to link OpenGL32.lib as well.
I know this question has been asked a lot of times here. But after trying all the mentioned solutions I am still not able to Compile the Test Boost code.
I have followed the following Steps for installation :-
Unzip Boost into a new directory.
Start a 64-bit MSVC command prompt and change to the directory where Boost was unzipped.
Run: bootstrap
Run: b2 toolset=msvc-10.0 --build-type=complete --libdir=C:\Boost\lib\x64 architecture=x86 address-model=64 install
Add C:\Boost\include\boost-(version) to your include path in Microsoft.Cpp.Win32.user property sheets.
Add C:\Boost\lib\x64 to your libs path in Microsoft.Cpp.Win32.user property sheets.
Additionally, I have added the lib path in additional library directory.
I am trying to compile a standard code to test whether boost is working properly or not.
#include <iostream>
#include <boost/shared_ptr.hpp>
#include <boost/regex.hpp>
using namespace std;
struct Hello
{
Hello(){
cout << "Hello constructor" << endl;
}
~Hello(){
cout << "Hello destructor" << endl;
cin.get();
}
};
int main(int argc, char**argv)
{
//Boost regex, compiled library
boost::regex regex("^(Hello|Bye) Boost$");
boost::cmatch helloMatches;
boost::regex_search("Hello Boost", helloMatches, regex);
cout << "The word between () is: " << helloMatches[1] << endl;
//Boost shared pointer, header only library
boost::shared_ptr<Hello> sharedHello(new Hello);
return 0;
}
The linker error I am getting is:-
1>Sample.obj : error LNK2019: unresolved external symbol "private: class boost::basic_regex<char,struct boost::regex_traits<char,class boost::w32_regex_traits<char> > > & __thiscall boost::basic_regex<char,struct boost::regex_traits<char,class boost::w32_regex_traits<char> > >::do_assign(char const *,char const *,unsigned int)" (?do_assign#?$basic_regex#DU?$regex_traits#DV?$w32_regex_traits#D#boost###boost###boost##AAEAAV12#PBD0I#Z) referenced in function "public: class boost::basic_regex<char,struct boost::regex_traits<char,class boost::w32_regex_traits<char> > > & __thiscall boost::basic_regex<char,struct boost::regex_traits<char,class boost::w32_regex_traits<char> > >::assign(char const *,char const *,unsigned int)" (?assign#?$basic_regex#DU?$regex_traits#DV?$w32_regex_traits#D#boost###boost###boost##QAEAAV12#PBD0I#Z)
1>Sample.obj : error LNK2019: unresolved external symbol "public: bool __thiscall boost::re_detail::perl_matcher<char const *,class std::allocator<struct boost::sub_match<char const *> >,struct boost::regex_traits<char,class boost::w32_regex_traits<char> > >::find(void)" (?find#?$perl_matcher#PBDV?$allocator#U?$sub_match#PBD#boost###std##U?$regex_traits#DV?$w32_regex_traits#D#boost###boost###re_detail#boost##QAE_NXZ) referenced in function "bool __cdecl boost::regex_search<char const *,class std::allocator<struct boost::sub_match<char const *> >,char,struct boost::regex_traits<char,class boost::w32_regex_traits<char> > >(char const *,char const *,class boost::match_results<char const *,class std::allocator<struct boost::sub_match<char const *> > > &,class boost::basic_regex<char,struct boost::regex_traits<char,class boost::w32_regex_traits<char> > > const &,enum boost::regex_constants::_match_flags,char const *)" (??$regex_search#PBDV?$allocator#U?$sub_match#PBD#boost###std##DU?$regex_traits#DV?$w32_regex_traits#D#boost###boost###boost##YA_NPBD0AAV?$match_results#PBDV?$allocator#U?$sub_match#PBD#boost###std###0#ABV?$basic_regex#DU?$regex_traits#DV?$w32_regex_traits#D#boost###boost###0#W4_match_flags#regex_constants#0#0#Z)
1>Sample.obj : error LNK2019: unresolved external symbol "private: void __thiscall boost::re_detail::perl_matcher<char const *,class std::allocator<struct boost::sub_match<char const *> >,struct boost::regex_traits<char,class boost::w32_regex_traits<char> > >::construct_init(class boost::basic_regex<char,struct boost::regex_traits<char,class boost::w32_regex_traits<char> > > const &,enum boost::regex_constants::_match_flags)" (?construct_init#?$perl_matcher#PBDV?$allocator#U?$sub_match#PBD#boost###std##U?$regex_traits#DV?$w32_regex_traits#D#boost###boost###re_detail#boost##AAEXABV?$basic_regex#DU?$regex_traits#DV?$w32_regex_traits#D#boost###boost###3#W4_match_flags#regex_constants#3##Z) referenced in function "public: __thiscall boost::re_detail::perl_matcher<char const *,class std::allocator<struct boost::sub_match<char const *> >,struct boost::regex_traits<char,class boost::w32_regex_traits<char> > >::perl_matcher<char const *,class std::allocator<struct boost::sub_match<char const *> >,struct boost::regex_traits<char,class boost::w32_regex_traits<char> > >(char const *,char const *,class boost::match_results<char const *,class std::allocator<struct boost::sub_match<char const *> > > &,class boost::basic_regex<char,struct boost::regex_traits<char,class boost::w32_regex_traits<char> > > const &,enum boost::regex_constants::_match_flags,char const *)" (??0?$perl_matcher#PBDV?$allocator#U?$sub_match#PBD#boost###std##U?$regex_traits#DV?$w32_regex_traits#D#boost###boost###re_detail#boost##QAE#PBD0AAV?$match_results#PBDV?$allocator#U?$sub_match#PBD#boost###std###2#ABV?$basic_regex#DU?$regex_traits#DV?$w32_regex_traits#D#boost###boost###2#W4_match_flags#regex_constants#2#0#Z)
1>C:\Users\J.A.R.V.I.S\documents\visual studio 2010\Projects\Boost Sample\Debug\Boost Sample.exe : fatal error LNK1120: 3 unresolved externals
1>
What am I missing here?
I am using VS2010 and windows 64bit.
Thanks
There were 2 issues which were giving the linker error:-
Additional linker dependencies absent at Properties->Linker->Input->AdditionalDependencies
Project was win32. Needed to convert it to x64 using configuration manager.
I'm trying to find a good example of how to use these binary wide character versions of boost's serialization stuff. I pieced together some code to try and get it working, but unfortunately I get bombarded with linker errors when trying to compile it.
Here's my code, in case I'm doing anything obviously wrong:
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <boost/archive/binary_woarchive.hpp>
#include <boost/archive/binary_wiarchive.hpp>
class testClass
{
public:
testClass()
{
}
testClass(const int intInput, const std::wstring stringInput, const float floatInput01, const float floatInput02)
{
ourString = stringInput;
testInt = intInput;
testFloat01 = floatInput01;
testFloat02 = floatInput02;
}
~testClass()
{}
int testInt;
std::wstring ourString;
float testFloat01;
float testFloat02;
int ReturnTestInt()
{
return testInt;
}
float RandomStuff()
{
float alpha01 = 26.9;
alpha01 /= 2;
return alpha01;
}
private:
friend class boost::serialization::access;
template<class Archive>
void serialize(Archive &ar, const unsigned int version)
{
ar &testInt;
ar &ourString;
ar &testFloat01;
ar &testFloat02;
}
};
int main()
{
std::vector<const testClass> objectStorage;
objectStorage.push_back(testClass(1, L"test\0", 9.14f, 6.662f));
objectStorage.push_back(testClass(2, L"temp\0", 0.29f, 3.331f));
objectStorage.push_back(testClass(3, L"then\0", 2.47f, 8.888f));
testClass testReceivedObject;
std::ifstream::pos_type size;
std::wofstream myFile;
boost::archive::binary_woarchive outputArchive(myFile);
myFile.open("Example.dat", std::ios::out | std::ios::binary);
if(myFile.is_open() && myFile.good())
{
std::cout<<"File opening successfully completed."<<std::endl;
unsigned int storageSize = objectStorage.size();
myFile.write(reinterpret_cast<wchar_t*>(&storageSize), (sizeof(unsigned int)));
for(int i = 0; i < objectStorage.size(); i++)
{
outputArchive<<objectStorage[i];
}
/*
myFile.write(reinterpret_cast<char*>(&objectStorage[0]), (sizeof(testClass)));
myFile.write(reinterpret_cast<char*>(&objectStorage[1]), (sizeof(testClass)));
myFile.write(reinterpret_cast<char*>(&objectStorage[2]), (sizeof(testClass)));
*/
}
else
{
std::cout<<"File opening NOT successfully completed."<<std::endl;
}
myFile.close();
std::wifstream myFileInput;
boost::archive::binary_wiarchive inputArchive(myFileInput);
myFileInput.open("Example.dat", std::ios::in | std::ios::binary | std::ios::ate);
if(myFileInput.is_open() && myFileInput.good())
{
std::cout<<"File opening successfully completed. Again."<<std::endl;
std::cout<<"READ:"<<std::endl;
size = myFileInput.tellg();
unsigned int numberOfObjects = 0;
myFileInput.seekg(0, std::ios::beg);
myFileInput.read(reinterpret_cast<wchar_t *>(&numberOfObjects), sizeof(unsigned int));
for(int i = 0; i < numberOfObjects; i++)
{
objectStorage.resize(objectStorage.size()+1);
inputArchive>>objectStorage[i];
//myFileInput.read(reinterpret_cast<wchar_t *>(&objectStorage[i])/*(&testReceivedObject)*/, sizeof(testClass));
}
std::cout<<std::endl<<"END."<<std::endl;
}
else
{
std::cout<<"Something has gone disasterously wrong."<<std::endl;
}
myFileInput.close();
for(int i = 0; i < objectStorage.size(); i++)
{
std::wcout<<objectStorage[i].ourString<<std::endl;
}
return 0;
}
Here are the errors:
1>main.obj : error LNK2019: unresolved external symbol "protected: __thiscall boost::archive::basic_binary_oprimitive<class boost::archive::binary_woarchive,wchar_t,struct std::char_traits<wchar_t> >::~basic_binary_oprimitive<class boost::archive::binary_woarchive,wchar_t,struct std::char_traits<wchar_t> >(void)" (??1?$basic_binary_oprimitive#Vbinary_woarchive#archive#boost##_WU?$char_traits#_W#std###archive#boost##IAE#XZ) referenced in function "public: __thiscall boost::archive::binary_oarchive_impl<class boost::archive::binary_woarchive,wchar_t,struct std::char_traits<wchar_t> >::~binary_oarchive_impl<class boost::archive::binary_woarchive,wchar_t,struct std::char_traits<wchar_t> >(void)" (??1?$binary_oarchive_impl#Vbinary_woarchive#archive#boost##_WU?$char_traits#_W#std###archive#boost##QAE#XZ)
1>main.obj : error LNK2019: unresolved external symbol "protected: __thiscall boost::archive::basic_binary_iprimitive<class boost::archive::binary_wiarchive,wchar_t,struct std::char_traits<wchar_t> >::~basic_binary_iprimitive<class boost::archive::binary_wiarchive,wchar_t,struct std::char_traits<wchar_t> >(void)" (??1?$basic_binary_iprimitive#Vbinary_wiarchive#archive#boost##_WU?$char_traits#_W#std###archive#boost##IAE#XZ) referenced in function "public: __thiscall boost::archive::binary_iarchive_impl<class boost::archive::binary_wiarchive,wchar_t,struct std::char_traits<wchar_t> >::~binary_iarchive_impl<class boost::archive::binary_wiarchive,wchar_t,struct std::char_traits<wchar_t> >(void)" (??1?$binary_iarchive_impl#Vbinary_wiarchive#archive#boost##_WU?$char_traits#_W#std###archive#boost##QAE#XZ)
1>main.obj : error LNK2019: unresolved external symbol "protected: __thiscall boost::archive::basic_binary_oprimitive<class boost::archive::binary_woarchive,wchar_t,struct std::char_traits<wchar_t> >::basic_binary_oprimitive<class boost::archive::binary_woarchive,wchar_t,struct std::char_traits<wchar_t> >(class std::basic_streambuf<wchar_t,struct std::char_traits<wchar_t> > &,bool)" (??0?$basic_binary_oprimitive#Vbinary_woarchive#archive#boost##_WU?$char_traits#_W#std###archive#boost##IAE#AAV?$basic_streambuf#_WU?$char_traits#_W#std###std##_N#Z) referenced in function "protected: __thiscall boost::archive::binary_oarchive_impl<class boost::archive::binary_woarchive,wchar_t,struct std::char_traits<wchar_t> >::binary_oarchive_impl<class boost::archive::binary_woarchive,wchar_t,struct std::char_traits<wchar_t> >(class std::basic_ostream<wchar_t,struct std::char_traits<wchar_t> > &,unsigned int)" (??0?$binary_oarchive_impl#Vbinary_woarchive#archive#boost##_WU?$char_traits#_W#std###archive#boost##IAE#AAV?$basic_ostream#_WU?$char_traits#_W#std###std##I#Z)
1>main.obj : error LNK2019: unresolved external symbol "protected: __thiscall boost::archive::basic_binary_iprimitive<class boost::archive::binary_wiarchive,wchar_t,struct std::char_traits<wchar_t> >::basic_binary_iprimitive<class boost::archive::binary_wiarchive,wchar_t,struct std::char_traits<wchar_t> >(class std::basic_streambuf<wchar_t,struct std::char_traits<wchar_t> > &,bool)" (??0?$basic_binary_iprimitive#Vbinary_wiarchive#archive#boost##_WU?$char_traits#_W#std###archive#boost##IAE#AAV?$basic_streambuf#_WU?$char_traits#_W#std###std##_N#Z) referenced in function "protected: __thiscall boost::archive::binary_iarchive_impl<class boost::archive::binary_wiarchive,wchar_t,struct std::char_traits<wchar_t> >::binary_iarchive_impl<class boost::archive::binary_wiarchive,wchar_t,struct std::char_traits<wchar_t> >(class std::basic_istream<wchar_t,struct std::char_traits<wchar_t> > &,unsigned int)" (??0?$binary_iarchive_impl#Vbinary_wiarchive#archive#boost##_WU?$char_traits#_W#std###archive#boost##IAE#AAV?$basic_istream#_WU?$char_traits#_W#std###std##I#Z)
1>main.obj : error LNK2019: unresolved external symbol "protected: void __thiscall boost::archive::basic_binary_oprimitive<class boost::archive::binary_woarchive,wchar_t,struct std::char_traits<wchar_t> >::init(void)" (?init#?$basic_binary_oprimitive#Vbinary_woarchive#archive#boost##_WU?$char_traits#_W#std###archive#boost##IAEXXZ) referenced in function "protected: void __thiscall boost::archive::binary_oarchive_impl<class boost::archive::binary_woarchive,wchar_t,struct std::char_traits<wchar_t> >::init(unsigned int)" (?init#?$binary_oarchive_impl#Vbinary_woarchive#archive#boost##_WU?$char_traits#_W#std###archive#boost##IAEXI#Z)
1>main.obj : error LNK2019: unresolved external symbol "protected: void __thiscall boost::archive::basic_binary_oarchive<class boost::archive::binary_woarchive>::init(void)" (?init#?$basic_binary_oarchive#Vbinary_woarchive#archive#boost###archive#boost##IAEXXZ) referenced in function "protected: void __thiscall boost::archive::binary_oarchive_impl<class boost::archive::binary_woarchive,wchar_t,struct std::char_traits<wchar_t> >::init(unsigned int)" (?init#?$binary_oarchive_impl#Vbinary_woarchive#archive#boost##_WU?$char_traits#_W#std###archive#boost##IAEXI#Z)
1>main.obj : error LNK2019: unresolved external symbol "protected: void __thiscall boost::archive::basic_binary_iprimitive<class boost::archive::binary_wiarchive,wchar_t,struct std::char_traits<wchar_t> >::init(void)" (?init#?$basic_binary_iprimitive#Vbinary_wiarchive#archive#boost##_WU?$char_traits#_W#std###archive#boost##IAEXXZ) referenced in function "protected: void __thiscall boost::archive::binary_iarchive_impl<class boost::archive::binary_wiarchive,wchar_t,struct std::char_traits<wchar_t> >::init(unsigned int)" (?init#?$binary_iarchive_impl#Vbinary_wiarchive#archive#boost##_WU?$char_traits#_W#std###archive#boost##IAEXI#Z)
1>main.obj : error LNK2019: unresolved external symbol "protected: void __thiscall boost::archive::basic_binary_iarchive<class boost::archive::binary_wiarchive>::init(void)" (?init#?$basic_binary_iarchive#Vbinary_wiarchive#archive#boost###archive#boost##IAEXXZ) referenced in function "protected: void __thiscall boost::archive::binary_iarchive_impl<class boost::archive::binary_wiarchive,wchar_t,struct std::char_traits<wchar_t> >::init(unsigned int)" (?init#?$binary_iarchive_impl#Vbinary_wiarchive#archive#boost##_WU?$char_traits#_W#std###archive#boost##IAEXI#Z)
1>main.obj : error LNK2019: unresolved external symbol "protected: void __thiscall boost::archive::basic_binary_iarchive<class boost::archive::binary_wiarchive>::load_override(struct boost::archive::class_name_type &,int)" (?load_override#?$basic_binary_iarchive#Vbinary_wiarchive#archive#boost###archive#boost##IAEXAAUclass_name_type#23#H#Z) referenced in function "protected: void __thiscall boost::archive::binary_iarchive_impl<class boost::archive::binary_wiarchive,wchar_t,struct std::char_traits<wchar_t> >::load_override<struct boost::archive::class_name_type>(struct boost::archive::class_name_type &,int)" (??$load_override#Uclass_name_type#archive#boost###?$binary_iarchive_impl#Vbinary_wiarchive#archive#boost##_WU?$char_traits#_W#std###archive#boost##IAEXAAUclass_name_type#12#H#Z)
1>main.obj : error LNK2019: unresolved external symbol "protected: void __thiscall boost::archive::basic_binary_oprimitive<class boost::archive::binary_woarchive,wchar_t,struct std::char_traits<wchar_t> >::save(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?save#?$basic_binary_oprimitive#Vbinary_woarchive#archive#boost##_WU?$char_traits#_W#std###archive#boost##IAEXABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###Z) referenced in function "public: static void __cdecl boost::archive::save_access::save_primitive<class boost::archive::binary_woarchive,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >(class boost::archive::binary_woarchive &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??$save_primitive#Vbinary_woarchive#archive#boost##V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###save_access#archive#boost##SAXAAVbinary_woarchive#12#ABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###Z)
1>main.obj : error LNK2019: unresolved external symbol "protected: void __thiscall boost::archive::basic_binary_oprimitive<class boost::archive::binary_woarchive,wchar_t,struct std::char_traits<wchar_t> >::save(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &)" (?save#?$basic_binary_oprimitive#Vbinary_woarchive#archive#boost##_WU?$char_traits#_W#std###archive#boost##IAEXABV?$basic_string#_WU?$char_traits#_W#std##V?$allocator#_W#2##std###Z) referenced in function "public: static void __cdecl boost::archive::save_access::save_primitive<class boost::archive::binary_woarchive,class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > >(class boost::archive::binary_woarchive &,class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &)" (??$save_primitive#Vbinary_woarchive#archive#boost##V?$basic_string#_WU?$char_traits#_W#std##V?$allocator#_W#2##std###save_access#archive#boost##SAXAAVbinary_woarchive#12#ABV?$basic_string#_WU?$char_traits#_W#std##V?$allocator#_W#2##std###Z)
1>main.obj : error LNK2019: unresolved external symbol "protected: void __thiscall boost::archive::basic_binary_iprimitive<class boost::archive::binary_wiarchive,wchar_t,struct std::char_traits<wchar_t> >::load(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > &)" (?load#?$basic_binary_iprimitive#Vbinary_wiarchive#archive#boost##_WU?$char_traits#_W#std###archive#boost##IAEXAAV?$basic_string#_WU?$char_traits#_W#std##V?$allocator#_W#2##std###Z) referenced in function "public: static void __cdecl boost::archive::load_access::load_primitive<class boost::archive::binary_wiarchive,class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > >(class boost::archive::binary_wiarchive &,class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > &)" (??$load_primitive#Vbinary_wiarchive#archive#boost##V?$basic_string#_WU?$char_traits#_W#std##V?$allocator#_W#2##std###load_access#archive#boost##SAXAAVbinary_wiarchive#12#AAV?$basic_string#_WU?$char_traits#_W#std##V?$allocator#_W#2##std###Z)
Advice on understanding what is wrong and how to resolve it would be greatly appreciated.
It turns out that boost/archive/binary_woarchive.hpp and boost/archive/binary_wiarchive.hpp are redundant.
Instead boost/archive/binary_oarchive.hpp and boost/archive/binary_iarchive.hpp will work just fine even for class instances that contain wide character variables!
I hope this information helps someone.