Unresolved external symbols when building Scintilla

Neomi
2013-08-11
2013-08-11
  • Neomi
    Neomi
    2013-08-11

    Hi,
    I want to test patch #467 and update it further to Scintilla 3.3.4, therefore I need to build Notepad++ from scratch. Building Notepad++ without touching the Scintilla directory works, building standard Scintilla without the Notepad++ modifications works too. But the modified Scintilla with support for Boost RegEx refuses to play nice.

    I am at revision 1103 (unmodified, I reverted to solve this problem first after building with the mentioned patch didn't work). I use Visual Studio 2010 Professional and am running nmake through the Visual Studio command prompt. Building Boost with BuildBoost.bat seems to have worked fine (version 1.54, toolkit "msvc-10.0"), at least I get no errors.

    Building Scintilla (after running "nmake -f scintilla.mak clean" first to be on the safe side) is problematic. Compilation works without any errors, but linking fails. This is the output I get:

            link -OPT:REF -LTCG -DEBUG -LIBPATH:D:\Libs\boost_1_54_0\bin.v2\libs\regex\build\msvc-10.0\release\link-static\runtime-link-static\threading-multi -DEF:Scintilla.def -DLL -OUT:..\bin\Scintilla.dll .\AutoComplete.obj .\CallTip.obj .\CellBuffer.obj .\CharacterSet.obj .\CharClassify.obj .\ContractionState.obj .\Decoration.obj .\Document.obj .\Editor.obj .\Indicator.obj .\KeyMap.obj .\LineMarker.obj .\PerLine.obj .\PlatWin.obj .\PositionCache.obj .\PropSetSimple.obj .\RESearch.obj .\RunStyles.obj .\ScintillaBase.obj .\ScintillaWin.obj .\Selection.obj .\Style.obj .\UniConversion.obj .\ViewStyle.obj .\XPM.obj .\BoostRegexSearch.obj .\UTF8DocumentIterator.obj .\ScintRes.res KERNEL32.lib USER32.lib GDI32.lib IMM32.lib OLE32.LIB
    Microsoft (R) Incremental Linker Version 10.00.40219.01
    Copyright (C) Microsoft Corporation.  All rights reserved.
    
    ScintillaWin.obj : warning LNK4197: export 'Scintilla_DirectFunction' specified multiple times; using first specification
       Creating library ..\bin\Scintilla.lib and object ..\bin\Scintilla.exp
    BoostRegexSearch.obj : error LNK2001: unresolved external symbol "private: class boost::basic_regex<wchar_t,struct boost::regex_traits<wchar_t,class boost::w32_regex_traits<wchar_t> > > & __cdecl boost::basic_regex<wchar_t,struct boost::regex_traits<wchar_t,class boost::w32_regex_traits<wchar_t> > >::do_assign(wchar_t const *,wchar_t const *,unsigned int)" (?do_assign@?$basic_regex@_WU?$regex_traits@_WV?$w32_regex_traits@_W@boost@@@boost@@@boost@@AEAAAEAV12@PEB_W0I@Z)
    BoostRegexSearch.obj : error LNK2001: unresolved external symbol "private: class boost::basic_regex<char,struct boost::regex_traits<char,class boost::w32_regex_traits<char> > > & __cdecl boost::basic_regex<char,struct boost::regex_traits<char,class boost::w32_regex_traits<char> > >::do_assign(char const *,char const *,unsigned int)" (?do_assign@?$basic_regex@DU?$regex_traits@DV?$w32_regex_traits@D@boost@@@boost@@@boost@@AEAAAEAV12@PEBD0I@Z)
    BoostRegexSearch.obj : error LNK2001: unresolved external symbol "char __cdecl boost::re_detail::do_global_lower(char)" (?do_global_lower@re_detail@boost@@YADD@Z)
    BoostRegexSearch.obj : error LNK2001: unresolved external symbol "wchar_t __cdecl boost::re_detail::do_global_lower(wchar_t)" (?do_global_lower@re_detail@boost@@YA_W_W@Z)
    BoostRegexSearch.obj : error LNK2001: unresolved external symbol "void __cdecl boost::re_detail::raise_runtime_error(class std::runtime_error const &)" (?raise_runtime_error@re_detail@boost@@YAXAEBVruntime_error@std@@@Z)
    BoostRegexSearch.obj : error LNK2001: unresolved external symbol "void __cdecl boost::re_detail::put_mem_block(void *)" (?put_mem_block@re_detail@boost@@YAXPEAX@Z)
    BoostRegexSearch.obj : error LNK2001: unresolved external symbol "bool __cdecl boost::re_detail::w32_is(unsigned int,unsigned int,wchar_t)" (?w32_is@re_detail@boost@@YA_NII_W@Z)
    BoostRegexSearch.obj : error LNK2001: unresolved external symbol "char __cdecl boost::re_detail::do_global_upper(char)" (?do_global_upper@re_detail@boost@@YADD@Z)
    BoostRegexSearch.obj : error LNK2001: unresolved external symbol "wchar_t __cdecl boost::re_detail::do_global_upper(wchar_t)" (?do_global_upper@re_detail@boost@@YA_W_W@Z)
    BoostRegexSearch.obj : error LNK2001: unresolved external symbol "void * __cdecl boost::re_detail::get_mem_block(void)" (?get_mem_block@re_detail@boost@@YAPEAXXZ)
    BoostRegexSearch.obj : error LNK2001: unresolved external symbol "wchar_t __cdecl boost::re_detail::w32_tolower(wchar_t,unsigned int)" (?w32_tolower@re_detail@boost@@YA_W_WI@Z)
    BoostRegexSearch.obj : error LNK2001: unresolved external symbol "void __cdecl boost::re_detail::verify_options(unsigned int,enum boost::regex_constants::_match_flags)" (?verify_options@re_detail@boost@@YAXIW4_match_flags@regex_constants@2@@Z)
    BoostRegexSearch.obj : error LNK2001: unresolved external symbol "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl boost::re_detail::w32_transform(unsigned int,char const *,char const *)" (?w32_transform@re_detail@boost@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IPEBD0@Z)
    BoostRegexSearch.obj : error LNK2001: unresolved external symbol "class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > __cdecl boost::re_detail::w32_transform(unsigned int,wchar_t const *,wchar_t const *)" (?w32_transform@re_detail@boost@@YA?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IPEB_W0@Z)
    BoostRegexSearch.obj : error LNK2001: unresolved external symbol "bool __cdecl boost::re_detail::is_combining_implementation(unsigned short)" (?is_combining_implementation@re_detail@boost@@YA_NG@Z)
    BoostRegexSearch.obj : error LNK2001: unresolved external symbol "char const * __cdecl boost::re_detail::get_default_error_string(enum boost::regex_constants::error_type)" (?get_default_error_string@re_detail@boost@@YAPEBDW4error_type@regex_constants@2@@Z)
    ..\bin\Scintilla.dll : fatal error LNK1120: 16 unresolved externals
    NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\amd64\link.EXE"' : return code '0x460'
    Stop.
    

    I tried the same with an older Boost version (1.48) to make sure this problem isn't specific to the current one, but the unresolved externals are the same. There must be something I am doing or setting up wrong. Can anyone help me?