<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>I'm attempting to use TagLib with Visual Studio 2017, and I'm having some difficulties getting the examples to work, specifically with respect to linker errors.  Here is a summary of what I've done so far:</div><div><br></div><div>The first course of action I took was to build TagLib using Visual Studio 2017 Community Edition.  I followed the directions in the INSTALL file and used CMake to create the appropriate Visual Studio .sln file.  In Visual Studio, I compiled the "tag" project and saw that a .lib static library was created called tag.lib.  <br></div><div><br></div><div>Next, I created a Windows console project called "retag4" within its own solution; I culled together all the header files associated with TagLib, and then I changed the properties of retag4 as follows:</div><div><br></div><div> - Under C/C++, I set "Additional Include Directories" to the location where I kept all the TagLib header files (I did this for All Configurations)</div><div> - Under Linker -> General, I updated "Additional Library Directories" to point to the location where my tag.lib file resides.</div><div> - Under Linker -> Input, I added "tag.lib" to "Additional Dependencies".</div><div><br></div><div>To test the tag.lib build, I pasted the code from examples/tagreader.cpp into retag4.cpp.  Specifically, I pasted in the #include directives and the main() function.  Initially, I don't see any compilation errors in Visual Studio, however when I do a full build on retag4, I get two C4251 warnings with the message:</div><div><br></div><div>'TagLib::FileName::m_name': class 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>' needs to have dll-interface to be used by clients of class 'TagLib::FileName'</div><div><br></div><div>'TagLib::FileName::m_wname': class 'std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>>' needs to have dll-interface to be used by clients of class 'TagLib::FileName'</div><div><br></div><div>There are also a series of LNK2019 errors with verbiage like this:</div><div><br></div><div>unresolved external symbol "__declspec(dllimport) public: virtual __thiscall TagLib::String::~String(void)" (__imp_??1String@TagLib@@UAE@XZ) referenced in function _main</div><div><br></div><div>Based on the first warning, it looks as though the _WIN32 macro is defined upon compilation, but it's not clear to me why I'm getting a warning here.  I've even tried rebuilding the tag project within the TagLib library such that it produces a .dll instead of a static .lib, but this results in MSVS complaining about an invalid .dll file.  <br></div><div><br></div><div>Apologies if this is a more basic question; I'm still fairly new to Windows programming.  Am I going down the correct path using Visual Studio to compile my retag4 code?  Should I be building a .lib file or a .dll file in this instance?</div><div><br></div><div>Thanks for any assistance you can provide.</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div></div></div></div>