Monday, July 16, 2007

Building Boost with MS Platform SDK AMD64 Cross-compiler

This post has been pretty hastily put together. I intend to change this over time and document how I built Boost libraries from source using the Microsoft Platform SDK 2003, for the x64 platform (AMD64 / EM64T).

1. Boost 1.31 - had to choose this rather older release because of certain constraints that our product has.

2. Microsoft Platform SDK 2003 R1. (Installed at "C:\Program Files\Microsoft Platform SDK") - no Visual Studio installation exists.

3. Using Boost.Build V1 rather than 2. Here is a mssdk-amd64-tools.jam file I created using the msvc-tools.jam at the following location under the Boost source dir:

boost_1_31_0\tools\build\v1

--- begin file



# Microsoft Platform SDK


# (C) Copyright David Abrahams 2001. Permission to copy, use,
# modify, sell and distribute this software is granted provided this
# copyright notice appears in all copies. This software is provided
# "as is" without express or implied warranty, and with no claim as
# to its suitability for any purpose.

# The following #// line will be used by the regression test table generation
# program as the column heading for HTML tables. Must not include version number.
#//Micro-
soft
VC++



# singleton variables...
set-as-singleton TARGETOS APPVER MSSdk VISUALC MSSDK_ROOT VC_TOOL_PATH VC_SETUP ;


# Get these variable set on the targets so that we can re-use the
# build actions for other toolsets using this one as a base.
flags mssdk VC_TOOL_PATH ;
flags mssdk VC_SETUP ;
flags mssdk VC_COMPILER ;
flags mssdk VC_LINKER ;
flags mssdk VC_PDB_NAME ;


# compute MSVC tool path
# You can either put the msvc bin directory in your PATH, or you can set
# MSVCDir to point at the msvc installation directory


# Some installations set MSSDK instead of MSSdk; who knows why?
MSSdk ?= $(MSSDK) ;


# If TARGETOS is not set the user hasn't run VCVARS32.BAT
if ! $(TARGETOS)
{
# In case someone set VISUALC in order to build Jam, we can just use that.
# MSSDK_ROOT ?= $(VISUALC) ;
# Otherwise, guess a standard installation directory


ProgramFiles ?= $(PROGRAMFILES) ;
MSSDK_ROOT ?= $(ProgramFiles:J=" ")"\\Microsoft Platform SDK" ;


# Reconstitutes paths containing spaces
MSSDK_ROOT = $(MSSDK_ROOT:J=" ") ;


# The tools are provisionallly located in the msvc6 bin
# directory. This may be overridden by toolsets which extend this
# one.
VC_TOOL_PATH = "$(MSSDK_ROOT)"$(SLASH)bin$(SLASH)win64$(SLASH)x86$(SLASH)AMD64$(SLASH) ;


# Always call VCVARS32.BAT before invoking the tools
VC_SETUP = "CALL \"$(VC_TOOL_PATH)..$(SLASH)..$(SLASH)..$(SLASH)..$(SLASH)SetEnv.Cmd\" /X64 >nul" ;
}
else
{
# Reconstitutes paths containing spaces
MSSdk = $(MSSdk:J=" ") ;


# Don't clobber adjoining text or use explicit paths if MSVCDir is already set
VC_TOOL_PATH = "" ;
}


VC_COMPILER = cl.exe ;
VC_LINKER = link.exe ;
VC_PDB_NAME = vc60 ;
VC_STDLIB_PATH = ;


flags mssdk CFLAGS on/object : /Z7 ;
flags mssdk CFLAGS on/database : /Zi ;
flags mssdk PDB_CFLAG on/database : /Fd ;
flags mssdk PDB_LINKFLAG on/database : /PDB: ;
flags mssdk LINKFLAGS on : /DEBUG ;
# The linker disables the default optimizations when using /DEBUG. Whe have
# to enable them manually for release builds with debug symbols.
# flags msvc LINKFLAGS on/release : /OPT:REF,ICF ;


flags mssdk CFLAGS speed : /O2 /Gs ;
flags mssdk CFLAGS off : /Od ;
flags mssdk CFLAGS space : /O1 /Gs ;
flags mssdk CFLAGS off : /Ob0 ;
flags mssdk CFLAGS on : /Ob1 ;
flags mssdk CFLAGS full : /Ob2 ;
flags mssdk CFLAGS on : /EHsc ;
flags mssdk CFLAGS on : /GR ;


# Note that these two options actually imply multithreading support on MSVC
# because there is no single-threaded dynamic runtime library. Specifying
# multi would be a bad idea, though, because no option would be
# matched when the build uses the default settings of dynamic
# and single.
flags mssdk CFLAGS release/dynamic : /MD ;
flags mssdk CFLAGS debug/dynamic : /MDd ;


# flags mssdk CFLAGS release/static/single : /ML ;
# flags mssdk CFLAGS debug/static/single : /MLd ;
flags mssdk CFLAGS release/static/multi : /MT ;
flags mssdk CFLAGS debug/static/multi : /MTd ;


flags mssdk CFLAGS ;
# flags mssdk CFLAGS /O2 ;
flags mssdk C++FLAGS ;
flags mssdk C++FLAGS : /Zc:forScope ;
feature native-wchar_t : on off ;
flags mssdk C++FLAGS on : /Zc:wchar_t ;
flags mssdk DEFINES ;
flags mssdk UNDEFS ;
flags mssdk HDRS ;
flags mssdk CRTSTDHDRS ;
flags mssdk STDHDRS ;
flags mssdk LINKFLAGS ;
flags mssdk ARFLAGS ;


flags mssdk STDHDRS : $(MSSdk)$(SLASH)include ;
flags mssdk CRTSTDHDRS : $(MSSdk)$(SLASH)include$(SLASH)crt ;
flags mssdk STDLIBPATH : $(MSSdk)$(SLASH)lib$(SLASH)AMD64 ;
flags mssdk LIBPATH ;
flags mssdk NEEDLIBS ;
flags mssdk FINDLIBS ;
flags mssdk LINKFLAGS $(SHARED_TYPES) : /DLL ;


flags mssdk LINKFLAGS console : /subsystem:console ;
flags mssdk LINKFLAGS gui : /subsystem:windows ;
flags mssdk LINKFLAGS wince : /subsystem:windowsce ;
flags mssdk LINKFLAGS native : /subsystem:native ;
flags mssdk LINKFLAGS auto : /subsystem:posix ;


flags mssdk LINKFLAGS x64 : /machine:AMD64 ;


flags mssdk LINKLIBS kernel32.lib user32.lib gdi32.lib ;


rule vc-set-pdb-file ( targets + : name )
{
local pdb = $(targets[1]:B=$(name):S=.pdb) ;
VC_PDB_FILE on $(targets) = $(pdb:G=:R=$(LOCATE_TARGET)) ;
LOCATE on $(pdb) = $(LOCATE_TARGET) ;
Clean clean : $(pdb) ;
}


#### Link ####


rule Link-action ( target implib ? : sources + : target-type ? )
{
with-command-file vc-Link $(<) : $(sources) $(NEEDLIBS) ;


gRUN_PATH($(<)) += $(VC_STDLIB_PATH) ;
if $(implib)
{
# incremental linking a DLL causes no end of problems: if the
# actual exports don't change, the import .lib file is never
# updated. Therefore, the .lib is always out-of-date and gets
# rebuilt every time. I'm not sure that incremental linking is
# such a great idea in general, but in this case I'm sure we
# don't want it.
NOINCREMENTAL on $(<) = /INCREMENTAL:NO ;
}
vc-set-pdb-file $(<) : $(target:B) ;
}


actions together vc-Link
{
$(VC_SETUP)
"$(VC_TOOL_PATH)$(VC_LINKER)" /nologo $(NOINCREMENTAL) $(LINKFLAGS) $(PDB_LINKFLAG)"$(VC_PDB_FILE)" /out:"$(<[1])" /IMPLIB:"$(<[2])" /LIBPATH:"$(LIBPATH)" /LIBPATH:"$(STDLIBPATH)" bufferoverflowU.lib $(LINKLIBS) "$(FINDLIBS:S=.lib)" @"$(>)"
}


#### Cc #####


rule Cc-action
{
vc-set-pdb-file $(<) : $(VC_PDB_NAME) ;
vc-Cc $(<) : $(>) ;
}


actions vc-Cc
{
$(VC_SETUP)
"$(VC_TOOL_PATH)$(VC_COMPILER)" /Zm800 -nologo -c -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) -I"$(HDRS)" -I"$(CRTSTDHDRS)" -I"$(STDHDRS)" $(PDB_CFLAG)"$(VC_PDB_FILE)" -Fo"$(<)" "$(>)"
}


#### C++ ####
rule C++-action
{
vc-set-pdb-file $(<) : $(VC_PDB_NAME) ;
vc-C++ $(<) : $(>) ;
}


actions vc-C++
{
$(VC_SETUP)
"$(VC_TOOL_PATH)$(VC_COMPILER)" /Zm800 -nologo /EHsc -c -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) $(C++FLAGS) -I"$(HDRS)" -I"$(CRTSTDHDRS)" -I"$(STDHDRS)" $(PDB_CFLAG)"$(VC_PDB_FILE)" -Fo"$(<)" -Tp"$(>)"
}


#### Archive ####
rule Archive-action
{
vc-set-pdb-file $(<) : $(<:B) ;
with-command-file vc-Archive $(<) : $(>) ;
}


actions vc-Archive
{
$(VC_SETUP)
if exist "$(<)" DEL "$(<)"
"$(VC_TOOL_PATH)$(VC_LINKER)" /lib $(ARFLAGS) $(PDB_LINKFLAG)"$(VC_PDB_FILE)" /out:"$(<)" @"$(>)" /machine:AMD64
}







--- end file




4. Everything seems to build fine except Boost.Regex. This fails while linking - apparently it cannot find a large number of template specializations of standard library classes for wchar_t.


The errors are shown below.


- Any idea why these symbols are not available.


- Is there a way I can turn off building Unicode support for Boost.Regex - can undef-ing BOOST_NO_WREGEX be of any help or should it be done with some other preprocessor symbol.


Errors:

vc-C++ bin\boost\libs\regex\build\boost_regex.dll\mssdk-amd64\debug\winstances.obj
winstances.cpp
Unknown compiler version - please run the configure tests and report the results
vc-Link bin\boost\libs\regex\build\boost_regex.dll\mssdk-amd64\debug\boost_regex-mssdk-gd-1_31.dll bin\boost\libs\regex\build\boost_regex.dll\mssdk-amd64\debug\boost_regex-mssdk-gd-1_31.lib
Creating library bin\boost\libs\regex\build\boost_regex.dll\mssdk-amd64\debug\boost_regex-mssdk-gd-1_31.lib and object bin\boost\libs\regex\build\boost_regex.dll\mssdk-amd64\debug\boost_regex-mssdk-gd-1_31.exp
wide_posix_api.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: wchar_t __cdecl std::ctype::tolower(wchar_t)const " (__imp_?tolower@?$ctype@_W@std@@QEBA_W_W@Z)
instances.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: wchar_t __cdecl std::ctype::tolower(wchar_t)const " (__imp_?tolower@?$ctype@_W@std@@QEBA_W_W@Z)
winstances.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: wchar_t __cdecl std::ctype::tolower(wchar_t)const " (__imp_?tolower@?$ctype@_W@std@@QEBA_W_W@Z)
posix_api.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: wchar_t __cdecl std::ctype::tolower(wchar_t)const " (__imp_?tolower@?$ctype@_W@std@@QEBA_W_W@Z)
regex.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: wchar_t __cdecl std::ctype::tolower(wchar_t)const " (__imp_?tolower@?$ctype@_W@std@@QEBA_W_W@Z)
regex_debug.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: wchar_t __cdecl std::ctype::tolower(wchar_t)const " (__imp_?tolower@?$ctype@_W@std@@QEBA_W_W@Z) referenced in function "void __cdecl regex_lib_print_compiler_macros(void)" (?regex_lib_print_compiler_macros@@YAXXZ)
w32_regex_traits.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: wchar_t __cdecl std::ctype::tolower(wchar_t)const " (__imp_?tolower@?$ctype@_W@std@@QEBA_W_W@Z)
c_regex_traits.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: wchar_t __cdecl std::ctype::tolower(wchar_t)const " (__imp_?tolower@?$ctype@_W@std@@QEBA_W_W@Z)
c_regex_traits_common.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: wchar_t __cdecl std::ctype::tolower(wchar_t)const " (__imp_?tolower@?$ctype@_W@std@@QEBA_W_W@Z)
cpp_regex_traits.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: wchar_t __cdecl std::ctype::tolower(wchar_t)const " (__imp_?tolower@?$ctype@_W@std@@QEBA_W_W@Z)
cregex.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: wchar_t __cdecl std::ctype::tolower(wchar_t)const " (__imp_?tolower@?$ctype@_W@std@@QEBA_W_W@Z)
wide_posix_api.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl std::basic_string,class std::allocator >::~basic_string,class std::allocator >(void)" (__imp_??1?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@XZ) referenced in function "public: static wchar_t __cdecl boost::w32_regex_traits::translate(wchar_t,bool)" (?translate@?$w32_regex_traits@_W@boost@@SA_W_W_N@Z)
instances.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl std::basic_string,class std::allocator >::~basic_string,class std::allocator >(void)" (__imp_??1?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@XZ)
winstances.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl std::basic_string,class std::allocator >::~basic_string,class std::allocator >(void)" (__imp_??1?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@XZ)
posix_api.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl std::basic_string,class std::allocator >::~basic_string,class std::allocator >(void)" (__imp_??1?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@XZ)
regex.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl std::basic_string,class std::allocator >::~basic_string,class std::allocator >(void)" (__imp_??1?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@XZ)
regex_debug.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl std::basic_string,class std::allocator >::~basic_string,class std::allocator >(void)" (__imp_??1?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@XZ)
w32_regex_traits.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl std::basic_string,class std::allocator >::~basic_string,class std::allocator >(void)" (__imp_??1?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@XZ)
c_regex_traits.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl std::basic_string,class std::allocator >::~basic_string,class std::allocator >(void)" (__imp_??1?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@XZ)
c_regex_traits_common.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl std::basic_string,class std::allocator >::~basic_string,class std::allocator >(void)" (__imp_??1?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@XZ)
cpp_regex_traits.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl std::basic_string,class std::allocator >::~basic_string,class std::allocator >(void)" (__imp_??1?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@XZ)
cregex.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl std::basic_string,class std::allocator >::~basic_string,class std::allocator >(void)" (__imp_??1?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@XZ)
wide_posix_api.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_string,class std::allocator > & __cdecl std::basic_string,class std::allocator >::operator=(class std::basic_string,class std::allocator > const &)" (__imp_??4?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEAV01@AEBV01@@Z)
instances.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_string,class std::allocator > & __cdecl std::basic_string,class std::allocator >::operator=(class std::basic_string,class std::allocator > const &)" (__imp_??4?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEAV01@AEBV01@@Z)
winstances.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_string,class std::allocator > & __cdecl std::basic_string,class std::allocator >::operator=(class std::basic_string,class std::allocator > const &)" (__imp_??4?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEAV01@AEBV01@@Z)
posix_api.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_string,class std::allocator > & __cdecl std::basic_string,class std::allocator >::operator=(class std::basic_string,class std::allocator > const &)" (__imp_??4?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEAV01@AEBV01@@Z)
regex.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_string,class std::allocator > & __cdecl std::basic_string,class std::allocator >::operator=(class std::basic_string,class std::allocator > const &)" (__imp_??4?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEAV01@AEBV01@@Z)
regex_debug.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::basic_string,class std::allocator > & __cdecl std::basic_string,class std::allocator >::operator=(class std::basic_string,class std::allocator > const &)" (__imp_??4?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEAV01@AEBV01@@Z) referenced in function "void __cdecl regex_lib_print_compiler_macros(void)" (?regex_lib_print_compiler_macros@@YAXXZ)
w32_regex_traits.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_string,class std::allocator > & __cdecl std::basic_string,class std::allocator >::operator=(class std::basic_string,class std::allocator > const &)" (__imp_??4?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEAV01@AEBV01@@Z)
c_regex_traits.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_string,class std::allocator > & __cdecl std::basic_string,class std::allocator >::operator=(class std::basic_string,class std::allocator > const &)" (__imp_??4?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEAV01@AEBV01@@Z)
c_regex_traits_common.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_string,class std::allocator > & __cdecl std::basic_string,class std::allocator >::operator=(class std::basic_string,class std::allocator > const &)" (__imp_??4?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEAV01@AEBV01@@Z)
cpp_regex_traits.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_string,class std::allocator > & __cdecl std::basic_string,class std::allocator >::operator=(class std::basic_string,class std::allocator > const &)" (__imp_??4?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEAV01@AEBV01@@Z)
cregex.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_string,class std::allocator > & __cdecl std::basic_string,class std::allocator >::operator=(class std::basic_string,class std::allocator > const &)" (__imp_??4?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEAV01@AEBV01@@Z)
wide_posix_api.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_string,class std::allocator > __cdecl std::collate::transform(wchar_t const *,wchar_t const *)const " (__imp_?transform@?$collate@_W@std@@QEBA?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@PEB_W0@Z)
instances.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_string,class std::allocator > __cdecl std::collate::transform(wchar_t const *,wchar_t const *)const " (__imp_?transform@?$collate@_W@std@@QEBA?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@PEB_W0@Z)
winstances.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_string,class std::allocator > __cdecl std::collate::transform(wchar_t const *,wchar_t const *)const " (__imp_?transform@?$collate@_W@std@@QEBA?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@PEB_W0@Z)
posix_api.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_string,class std::allocator > __cdecl std::collate::transform(wchar_t const *,wchar_t const *)const " (__imp_?transform@?$collate@_W@std@@QEBA?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@PEB_W0@Z)
regex.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_string,class std::allocator > __cdecl std::collate::transform(wchar_t const *,wchar_t const *)const " (__imp_?transform@?$collate@_W@std@@QEBA?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@PEB_W0@Z)
regex_debug.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::basic_string,class std::allocator > __cdecl std::collate::transform(wchar_t const *,wchar_t const *)const " (__imp_?transform@?$collate@_W@std@@QEBA?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@PEB_W0@Z) referenced in function "void __cdecl regex_lib_print_compiler_macros(void)" (?regex_lib_print_compiler_macros@@YAXXZ)
w32_regex_traits.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_string,class std::allocator > __cdecl std::collate::transform(wchar_t const *,wchar_t const *)const " (__imp_?transform@?$collate@_W@std@@QEBA?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@PEB_W0@Z)
c_regex_traits.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_string,class std::allocator > __cdecl std::collate::transform(wchar_t const *,wchar_t const *)const " (__imp_?transform@?$collate@_W@std@@QEBA?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@PEB_W0@Z)
c_regex_traits_common.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_string,class std::allocator > __cdecl std::collate::transform(wchar_t const *,wchar_t const *)const " (__imp_?transform@?$collate@_W@std@@QEBA?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@PEB_W0@Z)
cpp_regex_traits.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_string,class std::allocator > __cdecl std::collate::transform(wchar_t const *,wchar_t const *)const " (__imp_?transform@?$collate@_W@std@@QEBA?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@PEB_W0@Z)
cregex.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_string,class std::allocator > __cdecl std::collate::transform(wchar_t const *,wchar_t const *)const " (__imp_?transform@?$collate@_W@std@@QEBA?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@PEB_W0@Z)
wide_posix_api.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: unsigned __int64 __cdecl std::basic_string,class std::allocator >::size(void)const " (__imp_?size@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBA_KXZ)
instances.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: unsigned __int64 __cdecl std::basic_string,class std::allocator >::size(void)const " (__imp_?size@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBA_KXZ)
winstances.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: unsigned __int64 __cdecl std::basic_string,class std::allocator >::size(void)const " (__imp_?size@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBA_KXZ)
posix_api.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: unsigned __int64 __cdecl std::basic_string,class std::allocator >::size(void)const " (__imp_?size@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBA_KXZ)
regex.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: unsigned __int64 __cdecl std::basic_string,class std::allocator >::size(void)const " (__imp_?size@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBA_KXZ)
regex_debug.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: unsigned __int64 __cdecl std::basic_string,class std::allocator >::size(void)const " (__imp_?size@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBA_KXZ) referenced in function "void __cdecl regex_lib_print_compiler_macros(void)" (?regex_lib_print_compiler_macros@@YAXXZ)
w32_regex_traits.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: unsigned __int64 __cdecl std::basic_string,class std::allocator >::size(void)const " (__imp_?size@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBA_KXZ)
c_regex_traits.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: unsigned __int64 __cdecl std::basic_string,class std::allocator >::size(void)const " (__imp_?size@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBA_KXZ)
c_regex_traits_common.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: unsigned __int64 __cdecl std::basic_string,class std::allocator >::size(void)const " (__imp_?size@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBA_KXZ)
cpp_regex_traits.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: unsigned __int64 __cdecl std::basic_string,class std::allocator >::size(void)const " (__imp_?size@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBA_KXZ)
cregex.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: unsigned __int64 __cdecl std::basic_string,class std::allocator >::size(void)const " (__imp_?size@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBA_KXZ)
wide_posix_api.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: wchar_t const * __cdecl std::basic_string,class std::allocator >::c_str(void)const " (__imp_?c_str@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBAPEB_WXZ)
instances.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: wchar_t const * __cdecl std::basic_string,class std::allocator >::c_str(void)const " (__imp_?c_str@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBAPEB_WXZ)
winstances.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: wchar_t const * __cdecl std::basic_string,class std::allocator >::c_str(void)const " (__imp_?c_str@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBAPEB_WXZ)
posix_api.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: wchar_t const * __cdecl std::basic_string,class std::allocator >::c_str(void)const " (__imp_?c_str@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBAPEB_WXZ)
regex.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: wchar_t const * __cdecl std::basic_string,class std::allocator >::c_str(void)const " (__imp_?c_str@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBAPEB_WXZ)
regex_debug.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: wchar_t const * __cdecl std::basic_string,class std::allocator >::c_str(void)const " (__imp_?c_str@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBAPEB_WXZ) referenced in function "void __cdecl regex_lib_print_compiler_macros(void)" (?regex_lib_print_compiler_macros@@YAXXZ)
w32_regex_traits.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: wchar_t const * __cdecl std::basic_string,class std::allocator >::c_str(void)const " (__imp_?c_str@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBAPEB_WXZ)
c_regex_traits.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: wchar_t const * __cdecl std::basic_string,class std::allocator >::c_str(void)const " (__imp_?c_str@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBAPEB_WXZ)
c_regex_traits_common.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: wchar_t const * __cdecl std::basic_string,class std::allocator >::c_str(void)const " (__imp_?c_str@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBAPEB_WXZ)
cpp_regex_traits.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: wchar_t const * __cdecl std::basic_string,class std::allocator >::c_str(void)const " (__imp_?c_str@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBAPEB_WXZ)
cregex.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: wchar_t const * __cdecl std::basic_string,class std::allocator >::c_str(void)const " (__imp_?c_str@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBAPEB_WXZ)
wide_posix_api.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: bool __cdecl std::ctype::is(short,wchar_t)const " (__imp_?is@?$ctype@_W@std@@QEBA_NF_W@Z)
instances.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: bool __cdecl std::ctype::is(short,wchar_t)const " (__imp_?is@?$ctype@_W@std@@QEBA_NF_W@Z)
winstances.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: bool __cdecl std::ctype::is(short,wchar_t)const " (__imp_?is@?$ctype@_W@std@@QEBA_NF_W@Z)
posix_api.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: bool __cdecl std::ctype::is(short,wchar_t)const " (__imp_?is@?$ctype@_W@std@@QEBA_NF_W@Z)
regex.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: bool __cdecl std::ctype::is(short,wchar_t)const " (__imp_?is@?$ctype@_W@std@@QEBA_NF_W@Z)
regex_debug.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __cdecl std::ctype::is(short,wchar_t)const " (__imp_?is@?$ctype@_W@std@@QEBA_NF_W@Z) referenced in function "void __cdecl regex_lib_print_compiler_macros(void)" (?regex_lib_print_compiler_macros@@YAXXZ)
w32_regex_traits.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: bool __cdecl std::ctype::is(short,wchar_t)const " (__imp_?is@?$ctype@_W@std@@QEBA_NF_W@Z)
c_regex_traits.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: bool __cdecl std::ctype::is(short,wchar_t)const " (__imp_?is@?$ctype@_W@std@@QEBA_NF_W@Z)
c_regex_traits_common.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: bool __cdecl std::ctype::is(short,wchar_t)const " (__imp_?is@?$ctype@_W@std@@QEBA_NF_W@Z)
cpp_regex_traits.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: bool __cdecl std::ctype::is(short,wchar_t)const " (__imp_?is@?$ctype@_W@std@@QEBA_NF_W@Z)
cregex.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: bool __cdecl std::ctype::is(short,wchar_t)const " (__imp_?is@?$ctype@_W@std@@QEBA_NF_W@Z)
c_regex_traits.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::basic_string,class std::allocator > & __cdecl std::basic_string,class std::allocator >::append(unsigned __int64,wchar_t)" (__imp_?append@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEAV12@_K_W@Z) referenced in function "public: static bool __cdecl boost::c_regex_traits::lookup_collatename(class std::basic_string,class std::allocator > &,wchar_t const *,wchar_t const *)" (?lookup_collatename@?$c_regex_traits@_W@boost@@SA_NAEAV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@PEB_W1@Z)
cpp_regex_traits.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_string,class std::allocator > & __cdecl std::basic_string,class std::allocator >::append(unsigned __int64,wchar_t)" (__imp_?append@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEAV12@_K_W@Z)
w32_regex_traits.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_string,class std::allocator > & __cdecl std::basic_string,class std::allocator >::append(unsigned __int64,wchar_t)" (__imp_?append@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEAV12@_K_W@Z)
c_regex_traits.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::basic_string,class std::allocator > & __cdecl std::basic_string,class std::allocator >::operator=(wchar_t const *)" (__imp_??4?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEAV01@PEB_W@Z) referenced in function "public: static bool __cdecl boost::c_regex_traits::lookup_collatename(class std::basic_string,class std::allocator > &,wchar_t const *,wchar_t const *)" (?lookup_collatename@?$c_regex_traits@_W@boost@@SA_NAEAV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@PEB_W1@Z)
w32_regex_traits.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_string,class std::allocator > & __cdecl std::basic_string,class std::allocator >::operator=(wchar_t const *)" (__imp_??4?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEAV01@PEB_W@Z)
c_regex_traits.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl std::basic_string,class std::allocator >::basic_string,class std::allocator >(wchar_t const *,wchar_t const *,class std::allocator const &)" (__imp_??0?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@PEB_W0AEBV?$allocator@_W@1@@Z) referenced in function "public: static bool __cdecl boost::c_regex_traits::lookup_collatename(class std::basic_string,class std::allocator > &,wchar_t const *,wchar_t const *)" (?lookup_collatename@?$c_regex_traits@_W@boost@@SA_NAEAV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@PEB_W1@Z)
cpp_regex_traits.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl std::basic_string,class std::allocator >::basic_string,class std::allocator >(wchar_t const *,wchar_t const *,class std::allocator const &)" (__imp_??0?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@PEB_W0AEBV?$allocator@_W@1@@Z)
w32_regex_traits.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl std::basic_string,class std::allocator >::basic_string,class std::allocator >(wchar_t const *,wchar_t const *,class std::allocator const &)" (__imp_??0?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@PEB_W0AEBV?$allocator@_W@1@@Z)
winstances.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl std::basic_string,class std::allocator >::basic_string,class std::allocator >(wchar_t const *,wchar_t const *,class std::allocator const &)" (__imp_??0?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@PEB_W0AEBV?$allocator@_W@1@@Z)
winstances.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl std::basic_string,class std::allocator >::basic_string,class std::allocator >(class std::allocator const &)" (__imp_??0?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@AEBV?$allocator@_W@1@@Z)
c_regex_traits.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl std::basic_string,class std::allocator >::basic_string,class std::allocator >(class std::allocator const &)" (__imp_??0?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@AEBV?$allocator@_W@1@@Z) referenced in function "public: static void __cdecl boost::c_regex_traits::update(void)" (?update@?$c_regex_traits@_W@boost@@SAXXZ)
cpp_regex_traits.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl std::basic_string,class std::allocator >::basic_string,class std::allocator >(class std::allocator const &)" (__imp_??0?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@AEBV?$allocator@_W@1@@Z)
w32_regex_traits.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl std::basic_string,class std::allocator >::basic_string,class std::allocator >(class std::allocator const &)" (__imp_??0?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@AEBV?$allocator@_W@1@@Z)
wide_posix_api.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl std::basic_string,class std::allocator >::basic_string,class std::allocator >(class std::allocator const &)" (__imp_??0?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@AEBV?$allocator@_W@1@@Z)
c_regex_traits.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: wchar_t & __cdecl std::basic_string,class std::allocator >::operator[](unsigned __int64)" (__imp_??A?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEA_W_K@Z) referenced in function "public: static void __cdecl boost::c_regex_traits::transform_primary(class std::basic_string,class std::allocator > &,class std::basic_string,class std::allocator > const &)" (?transform_primary@?$c_regex_traits@_W@boost@@SAXAEAV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@AEBV34@@Z)
cpp_regex_traits.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: wchar_t & __cdecl std::basic_string,class std::allocator >::operator[](unsigned __int64)" (__imp_??A?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEA_W_K@Z)
w32_regex_traits.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: wchar_t & __cdecl std::basic_string,class std::allocator >::operator[](unsigned __int64)" (__imp_??A?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEA_W_K@Z)
winstances.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: wchar_t & __cdecl std::basic_string,class std::allocator >::operator[](unsigned __int64)" (__imp_??A?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEA_W_K@Z)
c_regex_traits.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::basic_string,class std::allocator > & __cdecl std::basic_string,class std::allocator >::erase(unsigned __int64,unsigned __int64)" (__imp_?erase@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEAV12@_K0@Z) referenced in function "public: static void __cdecl boost::c_regex_traits::transform_primary(class std::basic_string,class std::allocator > &,class std::basic_string,class std::allocator > const &)" (?transform_primary@?$c_regex_traits@_W@boost@@SAXAEAV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@AEBV34@@Z)
cpp_regex_traits.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_string,class std::allocator > & __cdecl std::basic_string,class std::allocator >::erase(unsigned __int64,unsigned __int64)" (__imp_?erase@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEAV12@_K0@Z)
w32_regex_traits.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_string,class std::allocator > & __cdecl std::basic_string,class std::allocator >::erase(unsigned __int64,unsigned __int64)" (__imp_?erase@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEAV12@_K0@Z)
c_regex_traits.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned __int64 const std::basic_string,class std::allocator >::npos" (__imp_?npos@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@2_KB)
cpp_regex_traits.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static unsigned __int64 const std::basic_string,class std::allocator >::npos" (__imp_?npos@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@2_KB) referenced in function "public: int __cdecl boost::cpp_regex_traits::toi(wchar_t)const " (?toi@?$cpp_regex_traits@_W@boost@@QEBAH_W@Z)
w32_regex_traits.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned __int64 const std::basic_string,class std::allocator >::npos" (__imp_?npos@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@2_KB)
c_regex_traits.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) bool __cdecl std::operator==,class std::allocator >(class std::basic_string,class std::allocator > const &,class std::basic_string,class std::allocator > const &)" (__imp_??$?8_WU?$char_traits@_W@std@@V?$allocator@_W@1@@std@@YA_NAEBV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@0@0@Z) referenced in function "unsigned int __cdecl boost::re_detail::find_sort_syntax,wchar_t>(class boost::c_regex_traits const *,wchar_t *)" (??$find_sort_syntax@V?$c_regex_traits@_W@boost@@_W@re_detail@boost@@YAIPEBV?$c_regex_traits@_W@1@PEA_W@Z)
cpp_regex_traits.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) bool __cdecl std::operator==,class std::allocator >(class std::basic_string,class std::allocator > const &,class std::basic_string,class std::allocator > const &)" (__imp_??$?8_WU?$char_traits@_W@std@@V?$allocator@_W@1@@std@@YA_NAEBV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@0@0@Z)
winstances.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) bool __cdecl std::operator==,class std::allocator >(class std::basic_string,class std::allocator > const &,class std::basic_string,class std::allocator > const &)" (__imp_??$?8_WU?$char_traits@_W@std@@V?$allocator@_W@1@@std@@YA_NAEBV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@0@0@Z)
c_regex_traits.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl std::basic_string,class std::allocator >::basic_string,class std::allocator >(unsigned __int64,wchar_t,class std::allocator const &)" (__imp_??0?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@_K_WAEBV?$allocator@_W@1@@Z) referenced in function "unsigned int __cdecl boost::re_detail::find_sort_syntax,wchar_t>(class boost::c_regex_traits const *,wchar_t *)" (??$find_sort_syntax@V?$c_regex_traits@_W@boost@@_W@re_detail@boost@@YAIPEBV?$c_regex_traits@_W@1@PEA_W@Z)
cpp_regex_traits.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl std::basic_string,class std::allocator >::basic_string,class std::allocator >(unsigned __int64,wchar_t,class std::allocator const &)" (__imp_??0?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@_K_WAEBV?$allocator@_W@1@@Z)
wide_posix_api.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl std::basic_string,class std::allocator >::basic_string,class std::allocator >(unsigned __int64,wchar_t,class std::allocator const &)" (__imp_??0?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@_K_WAEBV?$allocator@_W@1@@Z)
winstances.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl std::basic_string,class std::allocator >::basic_string,class std::allocator >(unsigned __int64,wchar_t,class std::allocator const &)" (__imp_??0?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@_K_WAEBV?$allocator@_W@1@@Z)
c_regex_traits.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: wchar_t const & __cdecl std::basic_string,class std::allocator >::operator[](unsigned __int64)const " (__imp_??A?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBAAEB_W_K@Z) referenced in function "unsigned int __cdecl boost::re_detail::count_chars,class std::allocator >,wchar_t>(class std::basic_string,class std::allocator > const &,wchar_t)" (??$count_chars@V?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@_W@re_detail@boost@@YAIAEBV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@_W@Z)
cpp_regex_traits.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: wchar_t const & __cdecl std::basic_string,class std::allocator >::operator[](unsigned __int64)const " (__imp_??A?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBAAEB_W_K@Z)
cpp_regex_traits.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: int __cdecl std::codecvt::out(int &,wchar_t const *,wchar_t const *,wchar_t const * &,char *,char *,char * &)const " (__imp_?out@?$codecvt@_WDH@std@@QEBAHAEAHPEB_W1AEAPEB_WPEAD3AEAPEAD@Z) referenced in function "class std::basic_string,class std::allocator > __cdecl boost::re_detail::to_narrow(class std::basic_string,class std::allocator > const &,class std::codecvt const &)" (?to_narrow@re_detail@boost@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@4@AEBV?$codecvt@_WDH@4@@Z)
cpp_regex_traits.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl std::basic_string,class std::allocator >::basic_string,class std::allocator >(class std::basic_string,class std::allocator > const &)" (__imp_??0?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@AEBV01@@Z) referenced in function "class std::basic_string,class std::allocator > __cdecl boost::re_detail::to_wide(class std::basic_string,class std::allocator > const &,class std::codecvt const &)" (?to_wide@re_detail@boost@@YA?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@4@AEBV?$codecvt@_WDH@4@@Z)
winstances.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl std::basic_string,class std::allocator >::basic_string,class std::allocator >(class std::basic_string,class std::allocator > const &)" (__imp_??0?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@AEBV01@@Z)
cpp_regex_traits.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: int __cdecl std::codecvt::in(int &,char const *,char const *,char const * &,wchar_t *,wchar_t *,wchar_t * &)const " (__imp_?in@?$codecvt@_WDH@std@@QEBAHAEAHPEBD1AEAPEBDPEA_W3AEAPEA_W@Z) referenced in function "class std::basic_string,class std::allocator > __cdecl boost::re_detail::to_wide(class std::basic_string,class std::allocator > const &,class std::codecvt const &)" (?to_wide@re_detail@boost@@YA?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@4@AEBV?$codecvt@_WDH@4@@Z)
cpp_regex_traits.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl std::basic_istream >::`vbase destructor'(void)" (__imp_??_D?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ) referenced in function "int `public: __cdecl boost::re_detail::message_data::message_data(class std::locale const &,class locale::basic_string,class std::allocator > const &)'::`1'::dtor$5" (?dtor$5@?0???0?$message_data@_W@re_detail@boost@@QEAA@AEBVlocale@std@@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@4@@Z@4HA)
cpp_regex_traits.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl std::messages::close(int)const " (__imp_?close@?$messages@_W@std@@QEBAXH@Z) referenced in function "public: __cdecl boost::re_detail::message_data::message_data(class std::locale const &,class std::basic_string,class std::allocator > const &)" (??0?$message_data@_W@re_detail@boost@@QEAA@AEBVlocale@std@@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@4@@Z)
cpp_regex_traits.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::basic_string,class std::allocator > __cdecl std::messages::get(int,int,int,class std::basic_string,class std::allocator > const &)const " (__imp_?get@?$messages@_W@std@@QEBA?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@HHHAEBV32@@Z) referenced in function "public: __cdecl boost::re_detail::message_data::message_data(class std::locale const &,class std::basic_string,class std::allocator > const &)" (??0?$message_data@_W@re_detail@boost@@QEAA@AEBVlocale@std@@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@4@@Z)
cpp_regex_traits.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: int __cdecl std::messages::open(class std::basic_string,class std::allocator > const &,class std::locale const &)const " (__imp_?open@?$messages@_W@std@@QEBAHAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@AEBVlocale@2@@Z) referenced in function "public: __cdecl boost::re_detail::message_data::message_data(class std::locale const &,class std::basic_string,class std::allocator > const &)" (??0?$message_data@_W@re_detail@boost@@QEAA@AEBVlocale@std@@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@4@@Z)
cpp_regex_traits.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::locale __cdecl std::basic_ios >::imbue(class std::locale const &)" (__imp_?imbue@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z) referenced in function "public: __cdecl boost::re_detail::message_data::message_data(class std::locale const &,class std::basic_string,class std::allocator > const &)" (??0?$message_data@_W@re_detail@boost@@QEAA@AEBVlocale@std@@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@4@@Z)
cpp_regex_traits.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl std::basic_istream >::basic_istream >(class std::basic_streambuf > *,bool)" (__imp_??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@_N@Z) referenced in function "public: __cdecl boost::re_detail::message_data::message_data(class std::locale const &,class std::basic_string,class std::allocator > const &)" (??0?$message_data@_W@re_detail@boost@@QEAA@AEBVlocale@std@@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@4@@Z)
cpp_regex_traits.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl std::basic_streambuf >::~basic_streambuf >(void)" (__imp_??1?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@UEAA@XZ) referenced in function "public: virtual __cdecl `anonymous namespace'::parser_buf >::~parser_buf >(void)" (??1?$parser_buf@_WU?$char_traits@_W@std@@@?A0x35f75ea7@@UEAA@XZ)
cpp_regex_traits.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::basic_istream > & __cdecl std::basic_istream >::operator>>(int &)" (__imp_??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAH@Z) referenced in function "public: int __cdecl boost::cpp_regex_traits::toi(wchar_t)const " (?toi@?$cpp_regex_traits@_W@boost@@QEBAH_W@Z)
cpp_regex_traits.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::basic_istream > & __cdecl std::basic_istream >::operator>>(class std::ios_base & (__cdecl*)(class std::ios_base &))" (__imp_??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z) referenced in function "public: int __cdecl boost::cpp_regex_traits::toi(wchar_t)const " (?toi@?$cpp_regex_traits@_W@boost@@QEBAH_W@Z)
cpp_regex_traits.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl std::basic_ios >::clear(int,bool)" (__imp_?clear@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAXH_N@Z) referenced in function "public: int __cdecl boost::cpp_regex_traits::toi(wchar_t)const " (?toi@?$cpp_regex_traits@_W@boost@@QEBAH_W@Z)
cpp_regex_traits.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::basic_streambuf > * __cdecl std::basic_streambuf >::pubsetbuf(wchar_t *,__int64)" (__imp_?pubsetbuf@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEA_W_J@Z) referenced in function "public: int __cdecl boost::cpp_regex_traits::toi(wchar_t)const " (?toi@?$cpp_regex_traits@_W@boost@@QEBAH_W@Z)
cpp_regex_traits.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __int64 __cdecl std::basic_streambuf >::in_avail(void)" (__imp_?in_avail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA_JXZ) referenced in function "public: int __cdecl boost::cpp_regex_traits::toi(wchar_t const * &,wchar_t const *,int)const " (?toi@?$cpp_regex_traits@_W@boost@@QEBAHAEAPEB_WPEB_WH@Z)
cpp_regex_traits.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: wchar_t const * __cdecl std::ctype::tolower(wchar_t *,wchar_t const *)const " (__imp_?tolower@?$ctype@_W@std@@QEBAPEB_WPEA_WPEB_W@Z) referenced in function "public: __cdecl boost::cpp_regex_traits::cpp_regex_traits(void)" (??0?$cpp_regex_traits@_W@boost@@QEAA@XZ)
cpp_regex_traits.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl std::basic_streambuf >::imbue(class std::locale const &)" (?imbue@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAXAEBVlocale@2@@Z)
cpp_regex_traits.obj : error LNK2001: unresolved external symbol "protected: virtual int __cdecl std::basic_streambuf >::sync(void)" (?sync@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAHXZ)
cpp_regex_traits.obj : error LNK2001: unresolved external symbol "protected: virtual __int64 __cdecl std::basic_streambuf >::xsputn(wchar_t const *,__int64)" (?xsputn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA_JPEB_W_J@Z)
cpp_regex_traits.obj : error LNK2001: unresolved external symbol "protected: virtual __int64 __cdecl std::basic_streambuf >::xsgetn(wchar_t *,__int64)" (?xsgetn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA_JPEA_W_J@Z)
cpp_regex_traits.obj : error LNK2001: unresolved external symbol "protected: virtual unsigned short __cdecl std::basic_streambuf >::uflow(void)" (?uflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAGXZ)
cpp_regex_traits.obj : error LNK2001: unresolved external symbol "protected: virtual unsigned short __cdecl std::basic_streambuf >::underflow(void)" (?underflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAGXZ)
cpp_regex_traits.obj : error LNK2001: unresolved external symbol "protected: virtual int __cdecl std::basic_streambuf >::showmanyc(void)" (?showmanyc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAHXZ)
cpp_regex_traits.obj : error LNK2001: unresolved external symbol "protected: virtual unsigned short __cdecl std::basic_streambuf >::pbackfail(unsigned short)" (?pbackfail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAGG@Z)
cpp_regex_traits.obj : error LNK2001: unresolved external symbol "protected: virtual unsigned short __cdecl std::basic_streambuf >::overflow(unsigned short)" (?overflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAGG@Z)
cpp_regex_traits.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) protected: __cdecl std::basic_streambuf >::basic_streambuf >(void)" (__imp_??0?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAA@XZ) referenced in function "public: __cdecl `anonymous namespace'::parser_buf >::parser_buf >(void)" (??0?$parser_buf@_WU?$char_traits@_W@std@@@?A0x35f75ea7@@QEAA@XZ)
cpp_regex_traits.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) bool __cdecl std::operator<,class std::allocator >(class std::basic_string,class std::allocator > const &,class std::basic_string,class std::allocator > const &)" (__imp_??$?M_WU?$char_traits@_W@std@@V?$allocator@_W@1@@std@@YA_NAEBV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@0@0@Z) referenced in function "public: bool __cdecl std::less,class std::allocator > >::operator()(class std::basic_string,class std::allocator > const &,class std::basic_string,class std::allocator > const &)const " (??R?$less@V?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@std@@QEBA_NAEBV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@1@0@Z)
winstances.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) bool __cdecl std::operator<,class std::allocator >(class std::basic_string,class std::allocator > const &,class std::basic_string,class std::allocator > const &)" (__imp_??$?M_WU?$char_traits@_W@std@@V?$allocator@_W@1@@std@@YA_NAEBV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@0@0@Z)
cpp_regex_traits.obj : error LNK2001: unresolved external symbol "protected: virtual char __cdecl std::ctype::do_narrow(wchar_t,char)const " (?do_narrow@?$ctype@_W@std@@MEBAD_WD@Z)
cpp_regex_traits.obj : error LNK2001: unresolved external symbol "protected: virtual wchar_t const * __cdecl std::ctype::do_narrow(wchar_t const *,wchar_t const *,char,char *)const " (?do_narrow@?$ctype@_W@std@@MEBAPEB_WPEB_W0DPEAD@Z)
cpp_regex_traits.obj : error LNK2001: unresolved external symbol "protected: virtual wchar_t __cdecl std::ctype::do_widen(char)const " (?do_widen@?$ctype@_W@std@@MEBA_WD@Z)
cpp_regex_traits.obj : error LNK2001: unresolved external symbol "protected: virtual char const * __cdecl std::ctype::do_widen(char const *,char const *,wchar_t *)const " (?do_widen@?$ctype@_W@std@@MEBAPEBDPEBD0PEA_W@Z)
cpp_regex_traits.obj : error LNK2001: unresolved external symbol "protected: virtual wchar_t __cdecl std::ctype::do_toupper(wchar_t)const " (?do_toupper@?$ctype@_W@std@@MEBA_W_W@Z)
cpp_regex_traits.obj : error LNK2001: unresolved external symbol "protected: virtual wchar_t const * __cdecl std::ctype::do_toupper(wchar_t *,wchar_t const *)const " (?do_toupper@?$ctype@_W@std@@MEBAPEB_WPEA_WPEB_W@Z)
cpp_regex_traits.obj : error LNK2001: unresolved external symbol "protected: virtual wchar_t __cdecl std::ctype::do_tolower(wchar_t)const " (?do_tolower@?$ctype@_W@std@@MEBA_W_W@Z)
cpp_regex_traits.obj : error LNK2001: unresolved external symbol "protected: virtual wchar_t const * __cdecl std::ctype::do_tolower(wchar_t *,wchar_t const *)const " (?do_tolower@?$ctype@_W@std@@MEBAPEB_WPEA_WPEB_W@Z)
cpp_regex_traits.obj : error LNK2001: unresolved external symbol "protected: virtual wchar_t const * __cdecl std::ctype::do_scan_not(short,wchar_t const *,wchar_t const *)const " (?do_scan_not@?$ctype@_W@std@@MEBAPEB_WFPEB_W0@Z)
cpp_regex_traits.obj : error LNK2001: unresolved external symbol "protected: virtual wchar_t const * __cdecl std::ctype::do_scan_is(short,wchar_t const *,wchar_t const *)const " (?do_scan_is@?$ctype@_W@std@@MEBAPEB_WFPEB_W0@Z)
cpp_regex_traits.obj : error LNK2001: unresolved external symbol "protected: virtual bool __cdecl std::ctype::do_is(short,wchar_t)const " (?do_is@?$ctype@_W@std@@MEBA_NF_W@Z)
cpp_regex_traits.obj : error LNK2001: unresolved external symbol "protected: virtual wchar_t const * __cdecl std::ctype::do_is(wchar_t const *,wchar_t const *,short *)const " (?do_is@?$ctype@_W@std@@MEBAPEB_WPEB_W0PEAF@Z)
cpp_regex_traits.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl std::ctype::ctype(unsigned __int64)" (__imp_??0?$ctype@_W@std@@QEAA@_K@Z) referenced in function "class std::ctype const & __cdecl std::use_facet >(class std::locale const &,class std::ctype const *,bool)" (??$use_facet@V?$ctype@_W@std@@@std@@YAAEBV?$ctype@_W@0@AEBVlocale@0@PEBV10@_N@Z)
cpp_regex_traits.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class std::locale::id std::ctype::id" (__imp_?id@?$ctype@_W@std@@2V0locale@2@A)
cpp_regex_traits.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl std::ctype::~ctype(void)" (__imp_??1?$ctype@_W@std@@UEAA@XZ) referenced in function "public: virtual void * __cdecl std::ctype::`scalar deleting destructor'(unsigned int)" (??_G?$ctype@_W@std@@UEAAPEAXI@Z)
cpp_regex_traits.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) protected: void __cdecl std::basic_streambuf >::setg(wchar_t *,wchar_t *,wchar_t *)" (__imp_?setg@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEA_W00@Z) referenced in function "protected: virtual class std::basic_streambuf > * __cdecl `anonymous namespace'::parser_buf >::setbuf(wchar_t *,__int64)" (?setbuf@?$parser_buf@_WU?$char_traits@_W@std@@@?A0x35f75ea7@@MEAAPEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@PEA_W_J@Z)
cpp_regex_traits.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) protected: wchar_t * __cdecl std::basic_streambuf >::eback(void)const " (__imp_?eback@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ) referenced in function "protected: virtual class std::fpos __cdecl `anonymous namespace'::parser_buf >::seekpos(class std::fpos,int)" (?seekpos@?$parser_buf@_WU?$char_traits@_W@std@@@?A0x35f75ea7@@MEAA?AV?$fpos@H@std@@V34@H@Z)
cpp_regex_traits.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) protected: wchar_t * __cdecl std::basic_streambuf >::egptr(void)const " (__imp_?egptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ) referenced in function "protected: virtual class std::fpos __cdecl `anonymous namespace'::parser_buf >::seekpos(class std::fpos,int)" (?seekpos@?$parser_buf@_WU?$char_traits@_W@std@@@?A0x35f75ea7@@MEAA?AV?$fpos@H@std@@V34@H@Z)
cpp_regex_traits.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) protected: wchar_t * __cdecl std::basic_streambuf >::gptr(void)const " (__imp_?gptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ) referenced in function "protected: virtual class std::fpos __cdecl `anonymous namespace'::parser_buf >::seekoff(__int64,enum std::ios_base::seekdir,int)" (?seekoff@?$parser_buf@_WU?$char_traits@_W@std@@@?A0x35f75ea7@@MEAA?AV?$fpos@H@std@@_JW4seekdir@ios_base@4@H@Z)
cpp_regex_traits.obj : error LNK2001: unresolved external symbol "protected: virtual int __cdecl std::codecvt::do_length(int &,wchar_t const *,wchar_t const *,unsigned __int64)const " (?do_length@?$codecvt@_WDH@std@@MEBAHAEAHPEB_W1_K@Z)
cpp_regex_traits.obj : error LNK2001: unresolved external symbol "protected: virtual int __cdecl std::codecvt::do_out(int &,wchar_t const *,wchar_t const *,wchar_t const * &,char *,char *,char * &)const " (?do_out@?$codecvt@_WDH@std@@MEBAHAEAHPEB_W1AEAPEB_WPEAD3AEAPEAD@Z)
cpp_regex_traits.obj : error LNK2001: unresolved external symbol "protected: virtual int __cdecl std::codecvt::do_in(int &,char const *,char const *,char const * &,wchar_t *,wchar_t *,wchar_t * &)const " (?do_in@?$codecvt@_WDH@std@@MEBAHAEAHPEBD1AEAPEBDPEA_W3AEAPEA_W@Z)
cpp_regex_traits.obj : error LNK2001: unresolved external symbol "protected: virtual int __cdecl std::codecvt::do_encoding(void)const " (?do_encoding@?$codecvt@_WDH@std@@MEBAHXZ)
cpp_regex_traits.obj : error LNK2001: unresolved external symbol "protected: virtual int __cdecl std::codecvt::do_max_length(void)const " (?do_max_length@?$codecvt@_WDH@std@@MEBAHXZ)
cpp_regex_traits.obj : error LNK2001: unresolved external symbol "protected: virtual bool __cdecl std::codecvt::do_always_noconv(void)const " (?do_always_noconv@?$codecvt@_WDH@std@@MEBA_NXZ)
cpp_regex_traits.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl std::codecvt::codecvt(unsigned __int64)" (__imp_??0?$codecvt@_WDH@std@@QEAA@_K@Z) referenced in function "class std::codecvt const & __cdecl std::use_facet >(class std::locale const &,class std::codecvt const *,bool)" (??$use_facet@V?$codecvt@_WDH@std@@@std@@YAAEBV?$codecvt@_WDH@0@AEBVlocale@0@PEBV10@_N@Z)
cpp_regex_traits.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class std::locale::id std::codecvt::id" (__imp_?id@?$codecvt@_WDH@std@@2V0locale@2@A)
cpp_regex_traits.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl std::codecvt::~codecvt(void)" (__imp_??1?$codecvt@_WDH@std@@UEAA@XZ) referenced in function "public: virtual void * __cdecl std::codecvt::`scalar deleting destructor'(unsigned int)" (??_G?$codecvt@_WDH@std@@UEAAPEAXI@Z)
cpp_regex_traits.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl std::messages::do_close(int)const " (?do_close@?$messages@_W@std@@MEBAXH@Z)
cpp_regex_traits.obj : error LNK2001: unresolved external symbol "protected: virtual class std::basic_string,class std::allocator > __cdecl std::messages::do_get(int,int,int,class std::basic_string,class std::allocator > const &)const " (?do_get@?$messages@_W@std@@MEBA?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@HHHAEBV32@@Z)
cpp_regex_traits.obj : error LNK2001: unresolved external symbol "protected: virtual int __cdecl std::messages::do_open(class std::basic_string,class std::allocator > const &,class std::locale const &)const " (?do_open@?$messages@_W@std@@MEBAHAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@AEBVlocale@2@@Z)
cpp_regex_traits.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl std::messages::messages(unsigned __int64)" (__imp_??0?$messages@_W@std@@QEAA@_K@Z) referenced in function "class std::messages const & __cdecl std::use_facet >(class std::locale const &,class std::messages const *,bool)" (??$use_facet@V?$messages@_W@std@@@std@@YAAEBV?$messages@_W@0@AEBVlocale@0@PEBV10@_N@Z)
cpp_regex_traits.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class std::locale::id std::messages::id" (__imp_?id@?$messages@_W@std@@2V0locale@2@A)
cpp_regex_traits.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl std::messages::~messages(void)" (__imp_??1?$messages@_W@std@@UEAA@XZ) referenced in function "public: virtual void * __cdecl std::messages::`scalar deleting destructor'(unsigned int)" (??_G?$messages@_W@std@@UEAAPEAXI@Z)
cpp_regex_traits.obj : error LNK2001: unresolved external symbol "protected: virtual long __cdecl std::collate::do_hash(wchar_t const *,wchar_t const *)const " (?do_hash@?$collate@_W@std@@MEBAJPEB_W0@Z)
cpp_regex_traits.obj : error LNK2001: unresolved external symbol "protected: virtual class std::basic_string,class std::allocator > __cdecl std::collate::do_transform(wchar_t const *,wchar_t const *)const " (?do_transform@?$collate@_W@std@@MEBA?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@PEB_W0@Z)
cpp_regex_traits.obj : error LNK2001: unresolved external symbol "protected: virtual int __cdecl std::collate::do_compare(wchar_t const *,wchar_t const *,wchar_t const *,wchar_t const *)const " (?do_compare@?$collate@_W@std@@MEBAHPEB_W000@Z)
cpp_regex_traits.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl std::collate::collate(unsigned __int64)" (__imp_??0?$collate@_W@std@@QEAA@_K@Z) referenced in function "class std::collate const & __cdecl std::use_facet >(class std::locale const &,class std::collate const *,bool)" (??$use_facet@V?$collate@_W@std@@@std@@YAAEBV?$collate@_W@0@AEBVlocale@0@PEBV10@_N@Z)
cpp_regex_traits.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class std::locale::id std::collate::id" (__imp_?id@?$collate@_W@std@@2V0locale@2@A)
cpp_regex_traits.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl std::collate::~collate(void)" (__imp_??1?$collate@_W@std@@UEAA@XZ) referenced in function "public: virtual void * __cdecl std::collate::`scalar deleting destructor'(unsigned int)" (??_G?$collate@_W@std@@UEAAPEAXI@Z)
wide_posix_api.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: int __cdecl std::basic_string,class std::allocator >::compare(wchar_t const *)const " (__imp_?compare@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBAHPEB_W@Z) referenced in function "wchar_t const * __cdecl boost::re_detail::re_is_set_member,class boost::detail::allocator >(wchar_t const *,wchar_t const *,struct boost::re_detail::re_set_long const *,class boost::reg_expression,class boost::detail::allocator > const &)" (??$re_is_set_member@PEB_W_WV?$regex_traits@_W@boost@@V?$allocator@_W@detail@2@@re_detail@boost@@YAPEB_WPEB_W0PEBUre_set_long@01@AEBV?$reg_expression@_WV?$regex_traits@_W@boost@@V?$allocator@_W@detail@2@@1@@Z)
winstances.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: int __cdecl std::basic_string,class std::allocator >::compare(wchar_t const *)const " (__imp_?compare@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBAHPEB_W@Z)
winstances.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl std::basic_string,class std::allocator >::basic_string,class std::allocator >(wchar_t const *,unsigned __int64,class std::allocator const &)" (__imp_??0?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@PEB_W_KAEBV?$allocator@_W@1@@Z) referenced in function "public: class boost::reg_expression,class boost::detail::allocator > & __cdecl boost::reg_expression,class boost::detail::allocator >::assign(wchar_t const *,unsigned __int64,unsigned int)" (?assign@?$reg_expression@_WV?$regex_traits@_W@boost@@V?$allocator@_W@detail@2@@boost@@QEAAAEAV12@PEB_W_KI@Z)
winstances.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: int __cdecl std::basic_string,class std::allocator >::compare(class std::basic_string,class std::allocator > const &)const " (__imp_?compare@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBAHAEBV12@@Z) referenced in function "public: int __cdecl boost::reg_expression,class boost::detail::allocator >::compare(class boost::reg_expression,class boost::detail::allocator > const &)const " (?compare@?$reg_expression@_WV?$regex_traits@_W@boost@@V?$allocator@_W@detail@2@@boost@@QEBAHAEBV12@@Z)
winstances.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::basic_string,class std::allocator > & __cdecl std::basic_string,class std::allocator >::operator=(wchar_t)" (__imp_??4?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEAV01@_W@Z) referenced in function "private: struct boost::re_detail::re_syntax_base * __cdecl boost::reg_expression,class boost::detail::allocator >::compile_set(wchar_t const * &,wchar_t const *)" (?compile_set@?$reg_expression@_WV?$regex_traits@_W@boost@@V?$allocator@_W@detail@2@@boost@@AEAAPEAUre_syntax_base@re_detail@2@AEAPEB_WPEB_W@Z)
winstances.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) bool __cdecl std::operator>=,class std::allocator >(class std::basic_string,class std::allocator > const &,class std::basic_string,class std::allocator > const &)" (__imp_??$?P_WU?$char_traits@_W@std@@V?$allocator@_W@1@@std@@YA_NAEBV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@0@0@Z) referenced in function "private: struct boost::re_detail::re_syntax_base * __cdecl boost::reg_expression,class boost::detail::allocator >::compile_set_aux(class boost::re_detail::jstack,class std::allocator >,class boost::detail::allocator > &,class boost::re_detail::jstack,class std::allocator >,class boost::detail::allocator > &,class boost::re_detail::jstack > &,class boost::re_detail::jstack,class std::allocator >,class boost::detail::allocator > &,bool,struct boost::re_detail::_narrow_type const &)" (?compile_set_aux@?$reg_expression@_WV?$regex_traits@_W@boost@@V?$allocator@_W@detail@2@@boost@@AEAAPEAUre_syntax_base@re_detail@2@AEAV?$jstack@V?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@V?$allocator@_W@detail@boost@@@42@0AEAV?$jstack@KV?$allocator@_W@detail@boost@@@42@0_NAEBU_narrow_type@42@@Z)
winstances.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) bool __cdecl std::operator<=,class std::allocator >(class std::basic_string,class std::allocator > const &,class std::basic_string,class std::allocator > const &)" (__imp_??$?N_WU?$char_traits@_W@std@@V?$allocator@_W@1@@std@@YA_NAEBV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@0@0@Z) referenced in function "private: struct boost::re_detail::re_syntax_base * __cdecl boost::reg_expression,class boost::detail::allocator >::compile_set_aux(class boost::re_detail::jstack,class std::allocator >,class boost::detail::allocator > &,class boost::re_detail::jstack,class std::allocator >,class boost::detail::allocator > &,class boost::re_detail::jstack > &,class boost::re_detail::jstack,class std::allocator >,class boost::detail::allocator > &,bool,struct boost::re_detail::_narrow_type const &)" (?compile_set_aux@?$reg_expression@_WV?$regex_traits@_W@boost@@V?$allocator@_W@detail@2@@boost@@AEAAPEAUre_syntax_base@re_detail@2@AEAV?$jstack@V?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@V?$allocator@_W@detail@boost@@@42@0AEAV?$jstack@KV?$allocator@_W@detail@boost@@@42@0_NAEBU_narrow_type@42@@Z)
bin\boost\libs\regex\build\boost_regex.dll\mssdk-amd64\debug\boost_regex-mssdk-gd-1_31.dll : fatal error LNK1120: 90 unresolved externals





PS: The source needed some patching - but this should not be too important I guess:





diff -cr orig/boost/detail/atomic_count_win32.hpp new/boost/detail/atomic_count_win32.hpp
*** orig/boost/detail/atomic_count_win32.hpp Mon Jul 16 21:02:50 2007
--- new/boost/detail/atomic_count_win32.hpp Mon Jul 16 21:01:03 2007
***************
*** 34,45 ****

// Intel 6.0 on Win64 version, posted by Tim Fenders to [boost-users]

! extern "C" long_type __cdecl _InterlockedIncrement(long volatile *);
! extern "C" long_type __cdecl _InterlockedDecrement(long volatile *);

#pragma intrinsic(_InterlockedIncrement)
#pragma intrinsic(_InterlockedDecrement)

inline long InterlockedIncrement(long volatile * lp)
{
return _InterlockedIncrement(lp);
--- 34,46 ----

// Intel 6.0 on Win64 version, posted by Tim Fenders to [boost-users]

! extern "C" long __cdecl _InterlockedIncrement(long volatile *);
! extern "C" long __cdecl _InterlockedDecrement(long volatile *);

#pragma intrinsic(_InterlockedIncrement)
#pragma intrinsic(_InterlockedDecrement)

+ #if defined( _M_IA64 )
inline long InterlockedIncrement(long volatile * lp)
{
return _InterlockedIncrement(lp);
***************
*** 50,55 ****
--- 51,63 ----
return _InterlockedDecrement(lp);
}

+ #elif defined( _M_AMD64 )
+
+ #define InterlockedIncrement _InterlockedIncrement
+ #define InterlockedDecrement _InterlockedDecrement
+
+ #endif
+
#else // _WIN64

extern "C" __declspec(dllimport) long __stdcall InterlockedIncrement(long volatile *);
Only in orig/boost/detail: iterator.hpp
diff -cr orig/boost/detail/lwm_win32.hpp new/boost/detail/lwm_win32.hpp
*** orig/boost/detail/lwm_win32.hpp Mon Jul 16 21:03:02 2007
--- new/boost/detail/lwm_win32.hpp Mon Jul 16 21:01:03 2007
***************
*** 38,51 ****

// Intel 6.0 on Win64 version, posted by Tim Fenders to [boost-users]

! extern "C" long_type __cdecl _InterlockedExchange(long volatile *, long);

#pragma intrinsic(_InterlockedExchange)

inline long InterlockedExchange(long volatile* lp, long l)
{
return _InterlockedExchange(lp, l);
}

#else // _WIN64

--- 38,57 ----

// Intel 6.0 on Win64 version, posted by Tim Fenders to [boost-users]

! extern "C" long __cdecl _InterlockedExchange(long volatile *, long);

#pragma intrinsic(_InterlockedExchange)

+ #if defined( _M_IA64 )
inline long InterlockedExchange(long volatile* lp, long l)
{
return _InterlockedExchange(lp, l);
}
+ #elif defined( _M_AMD64 )
+
+ #define InterlockedExchange _InterlockedExchange
+
+ #endif

#else // _WIN64




diff -cr orig/libs/regex/src/wide_posix_api.cpp new/libs/regex/src/wide_posix_api.cpp
*** orig/libs/regex/src/wide_posix_api.cpp Mon Jul 16 21:03:44 2007
--- new/libs/regex/src/wide_posix_api.cpp Mon Jul 16 21:01:03 2007
***************
*** 142,154 ****
{
if(std::wcscmp(e->re_endp, wnames[i]) == 0)
{
! std::swprintf(localbuf, 5, L"%d", i);
if(std::wcslen(localbuf) < buf_size)
std::wcscpy(buf, localbuf);
return std::wcslen(localbuf) + 1;
}
}
! std::swprintf(localbuf, 5, L"%d", 0);
if(std::wcslen(localbuf) < buf_size)
std::wcscpy(buf, localbuf);
return std::wcslen(localbuf) + 1;
--- 142,156 ----
{
if(std::wcscmp(e->re_endp, wnames[i]) == 0)
{
! //std::swprintf(localbuf, 5, L"%d", i);
! std::swprintf(localbuf, L"%d", i);
if(std::wcslen(localbuf) < buf_size)
std::wcscpy(buf, localbuf);
return std::wcslen(localbuf) + 1;
}
}
! //std::swprintf(localbuf, 5, L"%d", 0);
! std::swprintf(localbuf, L"%d", 0);
if(std::wcslen(localbuf) < buf_size)
std::wcscpy(buf, localbuf);
return std::wcslen(localbuf) + 1;
diff -cr orig/libs/thread/src/once.cpp new/libs/thread/src/once.cpp
*** orig/libs/thread/src/once.cpp Mon Jul 16 21:04:04 2007
--- new/libs/thread/src/once.cpp Mon Jul 16 21:01:03 2007
***************
*** 106,116 ****
--- 106,125 ----
return (LONG)(*ice)((LPVOID*)dest, (LPVOID)exch, (LPVOID)cmp);
}

+ //#pragma intrinsic(_InterlockedCompareExchange)
// The friendly form of InterlockedCompareExchange that defers
// according to the above function type wrappers.
inline LONG compare_exchange(volatile LPLONG dest, LONG exch, LONG cmp)
{
+ #ifdef _WIN64
+ // Picked from 1.34
+ // Original patch from Anthony Williams.
+ // I (Roland Schwarz) am trying this for RC_1_34_0, since x64 regressions are
+ // currently not run on x64 platforms for HEAD
+ return InterlockedCompareExchange(dest, exch,cmp);
+ #else
return ice_wrapper(&InterlockedCompareExchange, dest, exch, cmp);
+ #endif
}
}
#endif


Tuesday, June 19, 2007

List mania: C++ (and other) Books

This list includes almost all books that have been published on C++ and that are of any relevance today. More importantly, I have tried to exclude books which you really don't need to read at all - for example Robert Lafore's introductory book on C++. These may not be bad books - just that there are better, more readable books already available.

For the beginner
1. C++ Primer - Stan Lippman, Joseé Lajoie
2. Thinking in C++ (vol 1 & 2) - Bruce Eckel
3. Big C++ - Cay Horstmann, Timothy Budd

For the intermediate programmer (perhaps new to C++)
1. Accelerated C++ - Andrew König, Barbara Moo
2. The C++ Standard Library: Tutorial and Reference Guide - Nicolai M Josuttis
3. C++ Templates - Nicolai M Josuttis, David Vandevoorde
4. Essential C++ - Stan Lippman



For the practising C++ programmer
1. The C++ Programming Language - Bjarne Stroustrup
2. Effective C++ 3/e - Scott Meyers
3. More Effective C++ - Scott Meyers
4. Effective STL - Scott Meyers
5. More C++ Gems - ed Robert Martin
6. The STL Tutorial and Reference Guide - Dave Musser, Atul Saini (the ANSI standard edition)
7. Generic Programming with STL: ... - Matt Austern
8. Exceptional C++ - Herb Sutter
9. The C++ Standard Library Extensions: A tutorial and reference - Pete Becker
10. More Exceptional C++ - Herb Sutter
11. C++ Common Knowledge - Steve Dewhurst
12. Beyond the C++ Standard Library: An Introduction to Boost - Björn Karlsson
13. C++ Coding Standards: 101 guidelines ... - Herb Sutter, Andrei Alexandrescu
14. Large Scale C++ Software Design - John Lakos
15.
16.


For the Advanced Programmer
1. Design Patterns: Elements of Reusable object Oriented Software - Gamma, Helm, Vlissides, Hodgson
2. Modern C++ Design - Andrei Alexandrescu
3. Exceptional C++ Style - Herb Sutter
4. Template Metaprogramming: ... - Dave Abrahams, Aleksey Gurtovoy
5. Imperfect C++ - Matt Wilson
6. Pattern Hatching - John Vlissides
7.
8.
9.


For the language and standard junkie
1. The Design and Evolution of C++ - Bjarne Stroustrup
2. Inside the C++ Object Model - Stan Lippman
3.



Books on specific libraries outside C++ and Boost have not been mentioned. A separate list can be created for those.


Advanced books on specific topics
1. Boost Graph Library - Jeremy Siek, Lie-Quan Lee, Andrew Lumsdaine
2. Standard C++ IoStreams and Locales: ... - Angelika Langer, Klaus Kreft
3.
4.


Older books still worth a read
1. C++ Gems - ed Stan Lippman
(especially the part on Templates - includes original articles from Czarnecki, Eisencker and one more whose name I forgot)
2. The Annotated C++ Reference Manual - Stroustrup, Margaret Ellis
3. C++ Gotchas - Stephen Dewhurst
4. C++ Programming Style - Tom Cargill
5. Advanced C++ Programming Styles and Idioms - James Coplien

Wednesday, April 18, 2007

Basic terminal manipulation with C++ and ncurses

This one is a rather hastily written post. I frequent many online forums where newbies mob the lists and cause endless pain to the moderators with questions relating to some really evil non-standard ways of writing code that some compiler vendors of the Real Mode age popularised with their insipid IDEs. A large part of this concerns how to "clear the screen", "read a key press" and "position the cursor at some specified location" on the terminal screen.

I kind of figured out a plausible reason for this obsession with terminal manipulation. For some reason, the second program that some of these blokes have ever written after the customary "Hello, World!" was something like:

#include <stdio.h>
#include <conio.h>

void main()
{
clrscr();
printf("Hello, World!\n");
getch();
}

Now I don't mean to be taken too seriously on this "second program" thing, but what I do mean is that too many youngsters have tried writing programs like the one above without much clue about where all they are going wrong.
If you feel revolting while reading code in non-monospace red font you are with me. But at this point, if you do not have bigger concerns about this code than the typesetting, then read on, cause you ought to have had, and having not had it, you need enlightenment. If you do have, read on all the same because you might still need the technique described below.

The above program is awful, for a number of reasons - all of which relate to a severe flouting of coding standards and in fact a severe breach of language standards by compiler which encourages and compiles such code. void main is of course wrong, but conio.h is not a standard header, nor are clrscr() and getch() standard functions.


Clearing the screen is a no-no

Apart from the syntactic issues, there are semantic issues in this piece of code as well. Know this, if you are writing a text console-based application, normally you will not want to clear the user's screen through your code. You never know what kind of terminal the user is using and what kind of data might be on display on this terminal. If the terminal is of the kind that can't be scrolled back, and there was sensitive data on display that the user somehow needed, and you happen to clear the screen just as you started your program - then at the least you have helped the user to a pretty bad experience, and at the most your company can be sued for losses or at least your product can earn a bad usability rating.


Keypress inputs are not cool

Blocking on a keypress with getch() would have been fine in the above example, had getch been standard. But even if it was standard, taking single character inputs from the user in the form of keypresses is a pretty bad idea, if the key pressed by the user matters to the program. There are some exceptions to it, but in general you would want the user to type exactly what she means, take a long hard look to make sure that this is indeed her intended input, and then confirm by hitting the Return key. Thereafter, the input is yours. But you don't want to process accidental key-presses as valid inputs. Barring exceptions, the general rule of thumb is, then:

1. Do not clear the user's screen on your own
2. Do not take important inputs as key presses.



The ncurses way

Even if we agree on the semantic rules of terminal manipulation above, we still have several questions unanswered.

1. Exactly what are those exceptional conditions when these services might be required?
2. If code is being written on *nix systems, or for that matter on Windows also, what is a portable way of clearing the screen, registering key-presses and positioning the cursor at arbitrary locations?

These are the questions, answers to which we explore in the rest of this article. Along the way, we will develop a C++ class which can be used on Unix terminals fairly portably to do all the terminal manipulation. It should work even on Windows, if the appropriate (free) libraries are available for linking.

I chose to answer the second question ahead of the first because at this point I have had enough words and not enough code. I guess it's true for you too. So how would such an implementation look, and how are we going to use it.

The UnixTerminal class and its use

Here is the header file containing the definition of a class called UnixTerminal. This class needs to be instantiated with just two arguments passed to its constructor - the input file descriptor and output file descriptor.


// file: UnixTerminal.hpp
#ifndef __UNIX_TERMINAL__
#define __UNIX_TERMINAL__

#include <boost/shared_ptr.hpp>

#include <string>
#include <exception>


class UnixTerminal
{
public:
enum mode_t { read = 0, write = 1 };
UnixTerminal( int in_filedes = STDIN_FILENO, int out_filedes = STDOUT_FILENO );

bool clear();
int keyPress( bool echo = true );
bool setCursorAt( int x, int y );

int getLines();
int getCols();

friend UnixTerminal& operator << ( UnixTerminal&, const std::string&amp; out );


friend UnixTerminal& operator >> ( UnixTerminal&, std::string&amp; in );

private:
int get_screen_measure( const char* measure_name );

struct TermData;
boost::shared_ptr in_, out_;
bool in_eof_;

struct PutcToTerm;
};


struct TermException : std::exception {
TermException ( const char * msg ) throw() : what_(msg)
{}

const char* what() throw()
{
return what_.c_str();
}

~TermException() throw()
{}

private:
std::string what_;
};

#endif /*__UNIX_TERMINAL__*/



A typical use of this class will be in code like the following:


#include "UnixTerminal.hpp"
#include <iostream>

int main()
{
try {
UnixTerminal ut;
std::string s1 = "Yonatan Rabin";

// print message
ut << s1;
// register key-press - without echoing (false)
char ch = ut.keyPress(false);
// clear screen
ut.clear();
std::cout << ch << std::endl;

// position cursor at the middle of the screen
if ( ! ut.setCursorAt( ut.getCols()/2, ut.getLines()/2 ) )
std::cerr << "Could not set cursor position" << std::endl;

// take line input into s2
std::string s2;
ut >> s2;

std::cout << s2 << ": " << s2.length() << std::endl;
}
catch (std::exception &obj) {
std::cout << obj.what();
}

return 0;
}

The ncurses-based implementation

This section will be ready soon.

Wednesday, October 25, 2006

To throw or not to throw



Dispelling the myths and misgivings people have about throwing exceptions from constructors


In course of my four years of writing code, I have come across many cases where I write a C++ class that needs to do something fairly non-trivial in its constructor. The single biggest dilemma I have run into in such situations is to decide on what to do if some operation goes horribly wrong inside the constructor and all bets go off as far completing the construction is concerned.


First of all, do we throw an exception from a constructor? Is it valid C++, is it a correct practice, can it be recommended? In all this time, no one gave me an affirmative reply to any of these questions - no one from among my seniors, leads or peers. The correct answer however, to all of the questions posed here, is YES.
- Throwing exceptions from constructors is valid in C++.
- Throwing exceptions from constructors is correct and recommended when needed.


< ---- incomplete --- code examples will be added ------ >

Tuesday, October 24, 2006

Value-type casts of the new age

Easy and sensible type conversions of streamable object values / states


Last weekend I was trying to write for myself a small shim-class which will convert between bool and std::string data types. I wanted the conversions to also handle English words like "true", "yes" or "NO" in an intellligent way and convert them to boolean values.


I ended up writing a small set of classes which handle conversions between any two streamable types (in other words any type which can be inserted into an ostream object like cout and extracted from an istream object like cin). This work is not a purely original work - influenced by the semantics of boost::lexical_cast. It also uses a case-insensitive std::basic_string constructing which has been described by Herb Sutter in one of his GotW articles.


It's just that I might just want to use a lexical_cast facility without really bothering to use a whole new library for it (I love boost but if lexical_cast is the only thing I need from its offerings, I'd rather roll out my own, call it egotism if you will).


I have disallowed conversions to pointer types. I reckon the only conversion to a pointer type you will really ever need is to char* and you can manage with conversions std::string and then use c_str() accessor member function. If you want to convert from long to some pointer type use casts provided by the language (static_cast / reinterpret_cast).


I haven't looked at boost::lexical_cast's code and I am certain it will be tighter than mine. That notwithstanding, my code is listed below.





/* ---- this file is called conversion.hpp ---- */
#ifndef __CONVERSION_HPP__
#define __CONVERSION_HPP__

#include <sstream>

namespace MYUTILS {

// ---- Case-insensitive character string support ----
// *** WARNING - works only in en locales - ***

struct char_ci_traits : public std::char_traits<char>
{
static bool eq ( char c1, char c2 )
{
return ( toupper(c1) == toupper(c2) );
}


static bool ne ( char c1, char c2 )
{
return ( toupper(c1) != toupper(c2) );
}


static bool lt ( char c1, char c2 )
{
return ( toupper(c1) < toupper(c2) );
}


static int compare ( const char * s1,
const char * s2,
size_t n )
{
while ( n-- > 0 && toupper(*s1) == toupper(*s2) )
s1++,s2++;
return ( *s1 - *s2 );
}


static const char * find ( const char *s1, int n, char a )
{
while ( n-- >0 && toupper(*s1) != toupper(a) )
s1++;


return s1;
}
};


typedef std::basic_string<char, char_ci_traits> ci_string;




class bad_lexical_cast : public std::exception
{
public:
bad_lexical_cast( const std::string& error ) : std::exception(), msg_(error)
{
std::ostringstream strm;
strm << "Could not convert [ "
<< error.c_str()
<< " ] using lexical_cast";


msg_ = strm.str();
}


virtual ~bad_lexical_cast() throw()
{}


const char* what() const throw()
{
return msg_.c_str();
}


protected:
std::string msg_;
};


// ---- functor lexical cast ----
// converts between any two streamable types
// 1. For conversion to non-strings

template <typename U>
struct __inr_lexical_cast
{
template <typename T>
U operator () ( T val ) throw(bad_lexical_cast)
{
std::stringstream strm;
strm << val;
U retval;
strm >> retval;


if ( strm.bad() || strm.fail() ) {
throw bad_lexical_cast( strm.str() );
}


return retval;
}


// Optimization - type to same-type conversion
// No conversion is required - just return what passed to you

U operator () ( U val )
{
return val;
}
};


// 2. Second overload is for conversion to strings
// No conversion to "const char*" is provided specifically for this purpose

template <>
struct __inr_lexical_cast<std::string>
{
template <typename T>
std::string operator () ( T val )
{
std::stringstream strm;
strm << val;


return strm.str();
}


std::string operator () ( std::string val )
{
return val;
}
};



// 3. Some specialized string-to-bool conversions
// true, yes, y become 1 and false, no, no become 0
// - case insensitive so true=TRUE=TrUe, etc.

template <>
struct __inr_lexical_cast<bool>
{
template <typename T>
bool operator () ( T val ) throw(bad_lexical_cast)
{
std::stringstream strm;
strm << val;


return operator()( strm.str() );
}


bool operator () ( const std::string& str ) throw(bad_lexical_cast)
{
try{
int val = __inr_lexical_cast<int>()( str );
return (val)?true:false;
}
catch(...){}


ci_string istr = str.c_str();


if ( istr == "yes" || istr == "y" || istr == "true" )
return true;
else
if ( istr == "no" || istr == "n" || istr == "false" )
return false;
else
throw bad_lexical_cast(str);
}
};




// 4. Conversions to pointer-types are not supported
// To get char*, use lexical_cast<std::string> and use .c_str()
// of string

template <typename U>
struct __inr_lexical_cast <U*>
{
// No operator () provided
// Something like lexical_cast<char*>(my_obj) won't compile
};




// ---- Finally the template function front-end to the above functors ----
// - use this as:
// U Uval = lexical_cast<U>(Tval);
// - this syntax is more natural but slightly less-efficient

template <typename U, typename T>
U lexical_cast ( T val ) throw(bad_lexical_cast)
{
U retval = __inr_lexical_cast<U>()(val);

return retval;
}




} /*MYUTILS*/
#endif



The above code compiles on gcc 2.95 and above. The code does not compile on MSVC 6.0 and I am yet to test it on a later compiler (I have MSVC 7 and I guess it will compile on it).

Here is some stub code to test the above utilities:

// ---- this file is called lexical_cast_test.cpp -----

// lexical_cast_stub :
//


#include <iostream>
#include "conversion.hpp"

int main(int argc, char* argv[])
{
try {
std::string val = "52";
int num = MYUTILS::lexical_cast<int>(val);bool>(val); // expect num to contain 52

val = "TruE";
bool b = MYUTILS::lexical_cast<bool>(val); // expect b to contain true

val = "I am not a number";
num = MYUTILS::lexical_cast<int>(val); // this should throw bad_lexical_cast
}
catch ( std::exception& e )
{
std::cout << e.what ( ) << std::endl;
}

return 0;
}



This form of usage obviates the need for an elaborate set of conversion functions like atoi which can segfault or the [v]s*printf family of functions, whose use is clumsy.