Boost logo

Boost Users :

From: kchellap (kumar_at_[hidden])
Date: 2001-12-20 21:44:04


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<char,class _STL::char_traits<char>,class
_STL::allocator<char> > __cdecl
boost::re_detail::w32_traits_base::error_string(unsigned int)" (?
error_string_at_w3
2_traits_base_at_re_detail_at_boost@@SA?AV?$basic_string_at_DV?
$char_traits_at_D@_STL@@V?$allocator_at_D@2@@_STL@@I_at_Z)
snip1.obj : error LNK2001: unresolved external symbol "public: static
void __fastcall boost::w32_regex_traits<char>::transform_primary
(class _STL::basic_string<char,class _STL::char_traits<char>,class
_STL::allocator<char> > &,class _STL::basic_stri
ng<char,class _STL::char_traits<char>,class _STL::allocator<char> >
const &)" (?transform_primary@?$w32_regex_traits_at_D@boost@@SIXAAV?
$basic_string_at_DV?$char_traits_at_D@_STL@@V?
$allocator_at_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,class _STL::char_traits<char>,class
_STL::allocator<char> > &,char const *)"
(?do_lookup_collate_at_w32_traits_base_at_re_detail_at_boost@@KI_NAAV?
$basic_string_at_DV?$char_traits_at_D@_STL@@V?$allocator_at_D@2@@_STL@@PBD_at_Z)
snip1.obj : error LNK2001: unresolved external symbol "public: static
void __fastcall boost::w32_regex_traits<char>::transform(class
_STL::basic_string<char,class _STL::char_traits<char>,class
_STL::allocator<char> > &,class _STL::basic_string<char,
class _STL::char_traits<char>,class _STL::allocator<char> > const &)"
(?transform@?$w32_regex_traits_at_D@boost@@SIXAAV?$basic_string_at_DV?
$char_traits_at_D@_STL@@V?$allocator_at_D@2@@_STL@@ABV34@@Z)
vc6-stlport-re300m.lib(w32_regex_traits.obj) : error LNK2001:
unresolved external symbol __imp__LoadStringA_at_16
vc6-stlport-re300m.lib(w32_regex_traits.obj) : error LNK2001:
unresolved external symbol __imp__CharLowerW_at_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_at_[hidden]


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net