Hello,
I am using Boost 1.41.0 with Visual Studio 2005 and noticed some strange behaviour which I am unsure how to fix.
When I call boost::filesystem::remove_all("somepath");
everything compiles and links fine.
But now a project works entirely on wstring basis so it happens that I pass something like
boost::filesystem::remove_all(L"somepath");
Code compiles still fine but it throws many linker errors like
Fehler 2 error LNK2001: nresolved external symbol ""__declspec(dllimport) class boost::filesystem::file_status __cdecl boost::filesystem::detail::status_api(class std::basic_string
On 10 February 2010 16:03,
Hello, I am using Boost 1.41.0 with Visual Studio 2005 and noticed some strange behaviour which I am unsure how to fix.
When I call boost::filesystem::remove_all("somepath");
everything compiles and links fine.
But now a project works entirely on wstring basis so it happens that I pass something like
boost::filesystem::remove_all(L"somepath");
Code compiles still fine but it throws many linker errors like
Fehler 2 error LNK2001: nresolved external symbol ""__declspec(dllimport) class boost::filesystem::file_status __cdecl boost::filesystem::detail::status_api(class std::basic_string
const &,class boost::system::error_code &)" (__imp_?status_api@detail@filesystem@boost@@YA?AVfile_status@23 @ABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@ @AAVerror_code@system@3@@Z)". Fehler 3 error LNK2001: nresolved external symbol ""__declspec(dllimport) public: static class std::basic_string __cdecl boost::filesystem::wpath_traits::to_external(class boost::filesystem::basic_path ,struct boost::filesystem::wpath_traits> const &,class std::basic_string
const &)" (__imp_?to_external@wpath_traits@filesystem@boost@@SA?AV?$basic_string@GU ?$char_traits@G@std@@V?$allocator@G@2@@std@@ABV?$basic_path@V ?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@ @Uwpath_traits@filesystem@boost@@@23@ABV45@@Z)".
I assume your boost library (filesystem) has been built with wstring/wpath support... if so then the problem is likely that the boost library has been built with wchar_t as a built-in type, and you are building your code with wchar_t as an alias to "unsigned short"... That is a Microsoft option, something like /Zc:wchar_t- So you have to figure out who is what, and ensure that both your code and the libraries you link to are built the same. It looks like your code wants to use unsigned-short as wchar_t, so I'd try to *remove* the "/Zc:wchar_t-" option from your build options in your project. Hopefully all the other 3rd party libraries you are linking to also have the same option set. see ya Paul
participants (2)
-
ariasgore@gmx.de
-
Paul