From 1212c9afd3c3590661981949c1aae01cae17c271 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Thu, 5 Jun 2025 22:27:28 +0800 Subject: Fix 2 wstring linking errors to Boost filesystem The errors were: llfilesystem.lib(lldiskcache.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl boost::filesystem::detail::path_traits::convert(char const *,char const *,class std::basic_string,cla ss std::allocator > &,class std::codecvt const *)" (__imp_?convert@path_traits@detail@filesystem@boost@@YAXPEBD0AEAV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@PEBV?$codecvt@GDU_Mbstatet@@@6@@Z) refe renced in function "public: void __cdecl LLDiskCache::purge(void)" (?purge@LLDiskCache@@QEAAXXZ) [C:\Users\erik\Documents\Megapahit\viewer\build-mingw64_nt-10.0-19045-x86_64\newview\megapahit.vcxproj] Hint on symbols that are defined and could potentially match: "__declspec(dllimport) void __cdecl boost::filesystem::detail::path_traits::convert(char const *,char const *,class std::basic_string,class std::allocator > &,class std::codecvt const *)" (__imp_?convert@path_traits@detail@filesystem@boost@@YAXPEBD0AEAV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@PEBV?$codecvt@_WDU_Mbstatet@@@6@@Z) "__declspec(dllimport) void __cdecl boost::filesystem::detail::path_traits::convert(wchar_t const *,wchar_t const *,class std::basic_string,class std::allocator > &,class std::codecvt const *) " (__imp_?convert@path_traits@detail@filesystem@boost@@YAXPEB_W0AEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PEBV?$codecvt@_WDU_Mbstatet@@@6@@Z) llfilesystem.lib(lldir.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl boost::filesystem::detail::path_traits::convert(unsigned short const *,unsigned short const *,class std::basic_string,class std ::allocator > &,class std::codecvt const *)" (__imp_?convert@path_traits@detail@filesystem@boost@@YAXPEBG0AEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PEBV?$codecvt@GDU_Mbstatet@@@6@@Z) referenced in functi on "public: class std::vector,class std::allocator >,class std::allocator,class std::allocator > > > __cdecl LLDir::getFilesInDir(class std: :basic_string,class std::allocator > const &)" (?getFilesInDir@LLDir@@QEAA?AV?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@st d@@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@3@@Z) [C:\Users\erik\Documents\Megapahit\viewer\build-mingw64_nt-10.0-19045-x86_64\newview\megapahit.vcxproj] --- indra/llfilesystem/lldiskcache.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/llfilesystem/lldiskcache.cpp') diff --git a/indra/llfilesystem/lldiskcache.cpp b/indra/llfilesystem/lldiskcache.cpp index 49904911a9..58bbb995b0 100644 --- a/indra/llfilesystem/lldiskcache.cpp +++ b/indra/llfilesystem/lldiskcache.cpp @@ -159,7 +159,11 @@ void LLDiskCache::purge() } if (should_remove) { +#if LL_WINDOWS + boost::filesystem::remove(utf8str_to_utf16str(entry.second.second), ec); +#else boost::filesystem::remove(entry.second.second, ec); +#endif if (ec.failed()) { LL_WARNS() << "Failed to delete cache file " << entry.second.second << ": " << ec.message() << LL_ENDL; -- cgit v1.2.3 From 66251e9e06fb314b5d403d5faa83305f74b35a25 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Fri, 6 Jun 2025 10:28:39 +0800 Subject: Fix another wstring Boost filesystem linking error I couldn't get the LL_WARNS to link on Windows yet, so they're just disabled for now, they're only warnings to the users anyway. The error was: llfilesystem.lib(lldiskcache.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl boost::filesystem::detail::path_traits::convert(unsigned short const *,unsigned short const *,class std::basic_string,cla ss std::allocator > &,class std::codecvt const *)" (__imp_?convert@path_traits@detail@filesystem@boost@@YAXPEBG0AEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PEBV?$codecvt@GDU_Mbstatet@@@6@@Z) referenced in function "public: void __cdecl LLDiskCache::clearCache(void)" (?clearCache@LLDiskCache@@QEAAXXZ) [C:\Users\erik\Documents\Megapahit\viewer\build-mingw64_nt-10.0-19045-x86_64\newview\megapahit.vcxproj] --- indra/llfilesystem/lldiskcache.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'indra/llfilesystem/lldiskcache.cpp') diff --git a/indra/llfilesystem/lldiskcache.cpp b/indra/llfilesystem/lldiskcache.cpp index 58bbb995b0..d9b223fb49 100644 --- a/indra/llfilesystem/lldiskcache.cpp +++ b/indra/llfilesystem/lldiskcache.cpp @@ -114,14 +114,22 @@ void LLDiskCache::purge() { if (boost::filesystem::is_regular_file(*iter, ec) && !ec.failed()) { +#if LL_WINDOWS + if (utf16str_to_utf8str((*iter).path().wstring()).find(CACHE_FILENAME_PREFIX) != std::string::npos) +#else if ((*iter).path().string().find(CACHE_FILENAME_PREFIX) != std::string::npos) +#endif { uintmax_t file_size = boost::filesystem::file_size(*iter, ec); if (ec.failed()) { continue; } +#if LL_WINDOWS + const std::string file_path = utf16str_to_utf8str((*iter).path().wstring()); +#else const std::string file_path = (*iter).path().string(); +#endif const std::time_t file_time = boost::filesystem::last_write_time(*iter, ec); if (ec.failed()) { @@ -166,7 +174,9 @@ void LLDiskCache::purge() #endif if (ec.failed()) { +#if !LL_WINDOWS LL_WARNS() << "Failed to delete cache file " << entry.second.second << ": " << ec.message() << LL_ENDL; +#endif } } } @@ -241,12 +251,18 @@ void LLDiskCache::clearCache() { if (boost::filesystem::is_regular_file(*iter, ec) && !ec.failed()) { +#if LL_WINDOWS + if (utf16str_to_utf8str((*iter).path().wstring()).find(CACHE_FILENAME_PREFIX) != std::string::npos) +#else if ((*iter).path().string().find(CACHE_FILENAME_PREFIX) != std::string::npos) +#endif { boost::filesystem::remove(*iter, ec); if (ec.failed()) { +#if !LL_WINDOWS LL_WARNS() << "Failed to delete cache file " << *iter << ": " << ec.message() << LL_ENDL; +#endif } } } @@ -274,13 +290,20 @@ void LLDiskCache::removeOldVFSFiles() { if (boost::filesystem::is_regular_file(*iter, ec) && !ec.failed()) { +#if LL_WINDOWS + if ((utf16str_to_utf8str((*iter).path().wstring()).find(CACHE_FORMAT) != std::string::npos) || + (utf16str_to_utf8str((*iter).path().wstring()).find(DB_FORMAT) != std::string::npos)) +#else if (((*iter).path().string().find(CACHE_FORMAT) != std::string::npos) || ((*iter).path().string().find(DB_FORMAT) != std::string::npos)) +#endif { boost::filesystem::remove(*iter, ec); if (ec.failed()) { +#if !LL_WINDOWS LL_WARNS() << "Failed to delete cache file " << *iter << ": " << ec.message() << LL_ENDL; +#endif } } } @@ -315,7 +338,11 @@ uintmax_t LLDiskCache::dirFileSize(const std::string& dir) { if (boost::filesystem::is_regular_file(*iter, ec) && !ec.failed()) { +#if LL_WINDOWS + if (utf16str_to_utf8str((*iter).path().wstring()).find(CACHE_FILENAME_PREFIX) != std::string::npos) +#else if ((*iter).path().string().find(CACHE_FILENAME_PREFIX) != std::string::npos) +#endif { uintmax_t file_size = boost::filesystem::file_size(*iter, ec); if (!ec.failed()) -- cgit v1.2.3