[Locale] Link errors

I'm getting link errors with the latest Boost.Locale (v2.91) when trying to use the Win32 backend: [ 34%] Building CXX object CMakeFiles/boost_locale.dir/libs/locale/src/win32/win _backend.cpp.obj win_backend.cpp Linking CXX shared library boost_locale.dll Creating library boost_locale.lib and object boost_locale.exp win_backend.cpp.obj : error LNK2019: unresolved external symbol "unsigned int __ cdecl boost::locale::impl_win::locale_to_lcid(class std::basic_string<char,struc t std::char_traits<char>,class std::allocator<char> > const &)" (?locale_to_lcid @impl_win@locale@boost@@YAIABV?$basic_string@DU?$char_traits@D@std@@V?$allocator @D@2@@std@@@Z) referenced in function "public: __thiscall boost::locale::impl_wi n::winlocale::winlocale(class std::basic_string<char,struct std::char_traits<cha r>,class std::allocator<char> > const &)" (??0winlocale@impl_win@locale@boost@@Q AE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) boost_locale.dll : fatal error LNK1120: 1 unresolved externals I configured CMake as such: boost_locale_v2.91>cmake -G "NMake Makefiles" -DDISABLE_ICU=ON -DDISABLE_STD_BACKEND=ON -DCMAKE_INCLUDE_PATH="C:\boost" Where Boost is version 1.42. This is on Windows 7 32-bit. Any ideas? Alex -- Easy SFTP for Windows Explorer (http://www.swish-sftp.org)

On Mon, 20 Sep 2010 00:29:02 +0100, Alexander Lamaison wrote:
I'm getting link errors with the latest Boost.Locale (v2.91) when trying to use the Win32 backend:
win_backend.cpp.obj : error LNK2019: unresolved external symbol "unsigned int boost::locale::impl_win::locale_to_lcid( ... snip referenced in function "boost::locale::impl_win::winlocale::winlocale(
I configured CMake as such:
boost_locale_v2.91>cmake -G "NMake Makefiles" -DDISABLE_ICU=ON -DDISABLE_STD_BACKEND=ON -DCMAKE_INCLUDE_PATH="C:\boost"
It's down to this section of CMakeLists.txt: if(NOT DISABLE_WINAPI_BACKEND AND NOT DISABLE_STD_BACKEND) set(BOOST_LOCALE_SRC ${BOOST_LOCALE_SRC} libs/locale/src/win32/lcid.cpp ) endif() This means both win and std backends have to be compiled for lcid.cpp to be included. However, both backends depends on this being included so if you disable just one of them it fails to link. Alex -- Easy SFTP for Windows Explorer (http://www.swish-sftp.org)

I configured CMake as such:
boost_locale_v2.91>cmake -G "NMake Makefiles" -DDISABLE_ICU=ON -DDISABLE_STD_BACKEND=ON -DCMAKE_INCLUDE_PATH="C:\boost"
It's down to this section of CMakeLists.txt:
if(NOT DISABLE_WINAPI_BACKEND AND NOT DISABLE_STD_BACKEND) set(BOOST_LOCALE_SRC ${BOOST_LOCALE_SRC} libs/locale/src/win32/lcid.cpp ) endif()
This means both win and std backends have to be compiled for lcid.cpp to be included. However, both backends depends on this being included so if you disable just one of them it fails to link.
Alex
Thanks, Indeed, there should be "OR" and not "AND" between them. This fix is commited to svn However I had noticed that several tests fail with the combination of "-DDISABLE_ICU=ON -DDISABLE_STD_BACKEND=ON" under Windows. I'm going to check this. Artyom

On Sun, 19 Sep 2010 22:50:06 -0700 (PDT), Artyom wrote:
However I had noticed that several tests fail with the combination of "-DDISABLE_ICU=ON -DDISABLE_STD_BACKEND=ON" under Windows.
I'm going to check this.
I noticed this but assumed it was due to the limited localisation capabilities of Win32 v ICU. I think the same thing happened with "-DDISABLE_ICU=ON -DDISABLE_WINAPI_BACKEND=ON". Alex -- Easy SFTP for Windows Explorer (http://www.swish-sftp.org)

However I had noticed that several tests fail with the combination of "-DDISABLE_ICU=ON -DDISABLE_STD_BACKEND=ON" under Windows.
I'm going to check this.
I noticed this but assumed it was due to the limited localisation capabilities of Win32 v ICU. I think the same thing happened with "-DDISABLE_ICU=ON -DDISABLE_WINAPI_BACKEND=ON".
Alex
Even if the capabilities are limited the tests should not fail as they test capabilities of each backend separately. The major issue is actually very inconsistent behavior of MultiByteToWideChar when illegal codepoints are present, if Boost.Locale is linked with ICU or iconv it would prefer to use them on MultiByteToWideChar that is quite badly designed (IMHO). Actually I fixed this in SVN for Cygwin but still need to check this on MSVC. Artyom
participants (2)
-
Alexander Lamaison
-
Artyom