Boost logo

Boost :

Subject: Re: [boost] [Locale] Link errors
From: Alexander Lamaison (awl03_at_[hidden])
Date: 2010-09-19 20:22:10


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)

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk