Hi,
Newbie question. I am using one of the latest versions of boost
(not sure which version, but I downloaded it in Sept'00) and am using
it with stlport ver 4.5. I've been successful in using the
shared_ptr, shared_array, etc type of libraries with MSVC++ 6.0 (sp5)
on a Win2K machine (sp2).
However, recently I've been trying to get the regex library to work
but seem to be getting linker errors. As indicated in the
documentation, I set the env. using vcvars32, and used nmake to
compile and install the regex libraries (both .lib and .dll files).
As a sample I tried compiling snip1.cpp (in
boost_libs\regex\demo\snippets) from the command line:
D:\demo>cl /MT /D_MT -o snip1.exe -O2 -GX -GR snip1.cpp -link user
32.lib
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for
80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
snip1.cpp
Microsoft (R) Incremental Linker Version 6.00.8168
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.
/out:snip1.exe
user32.lib
snip1.obj
and the compile succeeded. However, when I set up the same options in
the MSVC++ IDE, I get the following linker errors:
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for
80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
cl /MT /GR /GX /O2 /D "_MT" /Fo"Debug/"
"D:\users\kumar\boost_libs\regex\demo\snippetsmsvc\snip1.cpp"
snip1.cpp
Microsoft (R) Incremental Linker Version 6.00.8168
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.
/out:snip1.exe
Debug/snip1.obj
snip1.obj : error LNK2001: unresolved external symbol "public: static
class _STL::basic_string __cdecl
boost::re_detail::w32_traits_base::error_string(unsigned int)" (?
error_string@w3
2_traits_base@re_detail@boost@@SA?AV?$basic_string@DV?
$char_traits@D@_STL@@V?$allocator@D@2@@_STL@@I@Z)
snip1.obj : error LNK2001: unresolved external symbol "public: static
void __fastcall boost::w32_regex_traits<char>::transform_primary
(class _STL::basic_string &,class _STL::basic_stri
ng
const &)" (?transform_primary@?$w32_regex_traits@D@boost@@SIXAAV?
$basic_string@DV?$char_traits@D@_STL@@V?
$allocator@D@2@@_STL@@ABV34@@Z)
snip1.obj : error LNK2001: unresolved external symbol "protected:
static bool __fastcall
boost::re_detail::w32_traits_base::do_lookup_collate(class
_STL::basic_string &,char const *)"
(?do_lookup_collate@w32_traits_base@re_detail@boost@@KI_NAAV?
$basic_string@DV?$char_traits@D@_STL@@V?$allocator@D@2@@_STL@@PBD@Z)
snip1.obj : error LNK2001: unresolved external symbol "public: static
void __fastcall boost::w32_regex_traits<char>::transform(class
_STL::basic_string &,class _STL::basic_string const &)"
(?transform@?$w32_regex_traits@D@boost@@SIXAAV?$basic_string@DV?
$char_traits@D@_STL@@V?$allocator@D@2@@_STL@@ABV34@@Z)
vc6-stlport-re300m.lib(w32_regex_traits.obj) : error LNK2001:
unresolved external symbol __imp__LoadStringA@16
vc6-stlport-re300m.lib(w32_regex_traits.obj) : error LNK2001:
unresolved external symbol __imp__CharLowerW@4
snip1.exe : fatal error LNK1120: 6 unresolved externals
Error executing cl.exe.
By looking at the verbose progress messages from the linker, it
appears that the following libs (stl-port and regex only - others not
shown) are being linked against:
Processed /DEFAULTLIB:vc6-stlport-re300m.lib
Processed /DEFAULTLIB:stlport_vc6_static.lib
I am stumped as to why the linker fails from inside the IDE but works
when used from the command line!
If anybody has an idea as to what is going on here or has a way to
fix it, I'd really appreciate any help.
Thanks,
Kumar Chellapilla
kumar@natural-selection.com