2014-02-17 2 views
9

Я попробовал почти неделю, чтобы построить надежные модули повышения + ICU под Windows и VC++ в виде библиотек STATIC в системе x86 (так что мне не понадобятся какие-либо исполняемые DLL-файлы). Мне в основном нужно увеличить regex с поддержкой Unicode и boost.locale.icu. Невозможно найти по всему Интернету какое-либо надежное решение (не на сайте boost или ICU) для этого. Пробовал строить с VC++, Cygwin + VC++, но пока ничего не добился. Любая помощь по опыту? Или, в худшем случае, любые статические + статические пакеты ICU с предварительной сборкой?Сборка boost + ICU под статическим связыванием Windows VC++ 2010

После того как я построил ICU статический, сконфигурированный под Cygwin:

bash runConfigureICU --enable-debug --disable-release Cygwin/MSVC --prefix=/cygdrive/c/icu/dist --enable-static --disable-shared 

получили следующие статические библиотеки:

02/17/2014 12:57 AM  23,505,784 sicudt.lib 
02/17/2014 12:56 AM   7,922,572 sicuin.lib 
02/17/2014 12:56 AM   101,218 sicuio.lib 
02/17/2014 12:56 AM   1,507,686 sicule.lib 
02/17/2014 12:56 AM   157,632 siculx.lib 
02/17/2014 12:56 AM   190,472 sicutest.lib 
02/17/2014 12:56 AM   1,749,872 sicutu.lib 
02/17/2014 12:56 AM   4,584,154 sicuuc.lib 

Я построил подталкивание как статические против ICU библиотек:

bjam --toolset=msvc-10.0 --build-dir="C:\local\build" address-model=32 threading=multi link=static runtime-link=static -sHAVE_ICU=1 -sICU_PATH="C:\icu" -sICU_LINK="/LIBPATH:C:\icu\lib sicuuc.lib sicuin.lib sicudt.lib" 

то при попытке простого кода я получаю неразрешенные символы, поэтому что-то не так с моей скомпилированной lib s:

cl.exe /MT /EHsc /O2 /I C:\local 
\boost_1_55_0 uniregboost.cpp /I C:\icu\include /link /SUBSYSTEM:CONSOLE advapi3 
2.lib sicuuc.lib sicuin.lib sicudt.lib /libpath:"C:\local\boost_1_55_0\stage\lib 
" /libpath:"C:\icu\lib" 
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01 for 80x86 
Copyright (C) Microsoft Corporation. All rights reserved. 

uniregboost.cpp 
Microsoft (R) Incremental Linker Version 10.00.30319.01 
Copyright (C) Microsoft Corporation. All rights reserved. 

/out:uniregboost.exe 
/SUBSYSTEM:CONSOLE 
advapi32.lib 
sicuuc.lib 
sicuin.lib 
sicudt.lib 
/libpath:C:\local\boost_1_55_0\stage\lib 
/libpath:C:\icu\lib 
uniregboost.obj 
MSVCRT.lib(MSVCR100.dll) : error LNK2005: _memmove already defined in LIBCMT.lib 
(memmove.obj) 
MSVCRT.lib(MSVCR100.dll) : error LNK2005: _malloc already defined in LIBCMT.lib(
malloc.obj) 
MSVCRT.lib(MSVCR100.dll) : error LNK2005: _realloc already defined in LIBCMT.lib 
(realloc.obj) 
MSVCRT.lib(MSVCR100.dll) : error LNK2005: _free already defined in LIBCMT.lib(fr 
ee.obj) 
MSVCRT.lib(MSVCR100.dll) : error LNK2005: _wcslen already defined in LIBCMT.lib(
wcslen.obj) 
MSVCRT.lib(MSVCR100.dll) : error LNK2005: _strtoul already defined in LIBCMT.lib 
(strtol.obj) 
MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_in 
fo(class type_info const &)" ([email protected]@[email protected]@@Z) already defined in LIBC 
MT.lib(typinfo.obj) 
MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall 
type_info::operator=(class type_info const &)" ([email protected]@[email protected]@@Z) a 
lready defined in LIBCMT.lib(typinfo.obj) 
LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; us 
e /NODEFAULTLIB:library 
uniregboost.obj : error LNK2019: unresolved external symbol "private: class boos 
t::basic_regex<int,class boost::icu_regex_traits> & __thiscall boost::basic_rege 
x<int,class boost::icu_regex_traits>::do_assign(int const *,int const *,unsigned 
int)" ([email protected][email protected][email protected]@@@[email protected]@[email protected] 
[email protected]) referenced in function "public: class boost::basic_regex<int,class boost::i 
cu_regex_traits> & __thiscall boost::basic_regex<int,class boost::icu_regex_trai 
ts>::assign(int const *,int const *,unsigned int)" ([email protected][email protected]_ 
[email protected]@@@[email protected]@[email protected]@Z) 
uniregboost.obj : error LNK2019: unresolved external symbol "public: class std:: 
vector<int,class std::allocator<int> > __thiscall boost::re_detail::icu_regex_tr 
aits_implementation::do_transform(int const *,int const *,class icu_52::Collator 
const *)const " ([email protected][email protected][email protected]@ 
@[email protected][email protected]@[email protected]@@[email protected]@[email protected][email protected]@@Z) reference 
d in function "public: class std::vector<int,class std::allocator<int> > __thisc 
all boost::re_detail::icu_regex_traits_implementation::transform(int const *,int 
const *)const " ([email protected][email protected][email protected]@@QB 
[email protected][email protected]@[email protected]@@[email protected]@[email protected]) 
uniregboost.obj : error LNK2019: unresolved external symbol "public: bool __this 
call boost::icu_regex_traits::isctype(int,unsigned __int64)const " ([email protected] 
[email protected]@@[email protected]) referenced in function "private: bool __thiscal 
l boost::re_detail::perl_matcher<class boost::u8_to_u32_iterator<class std::_Str 
ing_const_iterator<char,struct std::char_traits<char>,class std::allocator<char> 
>,int>,class std::allocator<struct boost::sub_match<class boost::u8_to_u32_iter 
ator<class std::_String_const_iterator<char,struct std::char_traits<char>,class 
std::allocator<char> >,int> > >,class boost::icu_regex_traits>::match_word_bound 
ary(void)" ([email protected][email protected][email protected]?$_String 
[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@@V?$alloca 
[email protected][email protected][email protected][email protected]?$char_traits 
@[email protected]@@[email protected]@[email protected]@[email protected]@[email protected]@@@[email protected]@@[email protected]@[email protected]@@re_de 
[email protected]@@AAE_NXZ) 
uniregboost.exe : fatal error LNK1120: 3 unresolved externals 

Я не забыл добавить статический флаг для СИС в моем коде:

#define U_STATIC_IMPLEMENTATION 

UPDATE:

перестроены все ICU и увеличить статический, теперь у меня есть только один ссылка на ошибку:

cl.exe /MT /EHsc /O2 /I C:\lib\b 
oost-1.55.0-vs2010\include\boost-1_55 uniregboost.cpp /I C:\lib\icu-52.1-vs2010\ 
include /link /SUBSYSTEM:CONSOLE advapi32.lib sicuuc.lib sicuin.lib sicudt.lib s 
icuuc.lib /libpath:"C:\lib\boost-1.55.0-vs2010\lib" /libpath:"C:\lib\icu-52.1-vs 
2010\lib" 
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01 for 80x86 
Copyright (C) Microsoft Corporation. All rights reserved. 

uniregboost.cpp 
Microsoft (R) Incremental Linker Version 10.00.30319.01 
Copyright (C) Microsoft Corporation. All rights reserved. 

/out:uniregboost.exe 
/SUBSYSTEM:CONSOLE 
advapi32.lib 
sicuuc.lib 
sicuin.lib 
sicudt.lib 
sicuuc.lib 
/libpath:C:\lib\boost-1.55.0-vs2010\lib 
/libpath:C:\lib\icu-52.1-vs2010\lib 
uniregboost.obj 
    Creating library uniregboost.lib and object uniregboost.exp 
libboost_regex-vc100-mt-s-1_55.lib(icu.obj) : warning LNK4217: locally defined s 
ymbol [email protected][email protected]@[email protected]@@Z (public: __thiscall icu_52::Locale::Locale(
class icu_52::Locale const &)) imported in function "public: class icu_52::Local 
e __thiscall boost::re_detail::icu_regex_traits_implementation::getloc(void)cons 
t " ([email protected][email protected][email protected]@@[email protected]_5 
[email protected]@XZ) 
libboost_regex-vc100-mt-s-1_55.lib(icu.obj) : warning LNK4217: locally defined s 
ymbol [email protected][email protected]@[email protected] (public: __thiscall icu_52::Locale::Locale(void)) 
imported in function "public: class icu_52::Locale __thiscall boost::icu_regex_ 
traits::getloc(void)const " ([email protected][email protected]@@[email protected]_52 
@@XZ) 
libboost_regex-vc100-mt-s-1_55.lib(icu.obj) : warning LNK4217: locally defined s 
ymbol [email protected][email protected]@[email protected] (public: virtual __thiscall icu_52::Locale::~Loca 
le(void)) imported in function "public: __thiscall boost::re_detail::icu_regex_t 
raits_implementation::~icu_regex_traits_implementation(void)" (??1icu_regex_trai 
[email protected][email protected]@@[email protected]) 
libboost_regex-vc100-mt-s-1_55.lib(icu.obj) : error LNK2019: unresolved external 
symbol "__declspec(dllimport) public: static class icu_52::Collator * __cdecl i 
cu_52::Collator::createInstance(class icu_52::Locale const &,enum UErrorCode &)" 
([email protected]@[email protected]@[email protected]@[email protected]@@@Z) 
referenced in function "public: __thiscall boost::re_detail::icu_regex_traits_i 
mplementation::icu_regex_traits_implementation(class icu_52::Locale const &)" (? 
[email protected][email protected]@@[email protected]@[email protected]@@Z) 
uniregboost.exe : fatal error LNK1120: 1 unresolved externals 
+0

Вы пробовали список почтовых отправлений. Это активное и очень поддерживающее сообщество. –

+0

Моя проблема заключается в том, чтобы активировать ICU, а не просто повысить или просто ICU. – bsteo

+0

Я попытался увеличить списки рассылки и канал IRC. Пока нет помощи. – bsteo

ответ

1

Мне еще не разрешено комментировать, поэтому я даю свой комментарий в качестве ответа (извините за неудобство что я борюсь с одной и той же проблемой. Я обнаружил следующий тестовый файл:

<boost>\libs\locale\build\has_icu_test.cpp 

с этими строками кода:

#if defined(_MSC_VER) && !defined(_DLL) 
#error "Mixing ICU with a static runtime doesn't work" 
#endif 

Может быть (по крайней мере на Windows) статический импульс с ICU компиляции не представляется возможным?

+0

Да, может быть так ... Под Linux - кусок пирога, под Windows я не знаю, не успеваю ... – bsteo

0

Вы строите правильный путь. Проблема в том, что система сборки Boost.Locale, похоже, не имеет кода для обнаружения статических библиотек ICU, и поэтому, даже если вы установите все правильные параметры, он не подберет библиотеки, как ожидалось. Если вы проверяете эти файлы:

libs\locale\build\Jamfile.v2 
libs\regex\build\Jamfile.v2 

вы заметите, что там, кажется, нет никакого кода, чтобы зондировать для sicuXX.XXX файлов. Я думаю, что это может быть проблемой.

Существует запрос функции для этого на подталкивание багтрекер: https://svn.boost.org/trac/boost/ticket/9685

Это может помочь, если больше людей проявляют интерес к этой стадии реализации.

Смежные вопросы