Boost logo

Boost Users :

From: Jonathan Turkanis (turkanis_at_[hidden])
Date: 2008-02-14 12:58:58


Holger Bast wrote:
> --===============0292832754==
> Content-Type: multipart/alternative;
> boundary="----=_Part_3129_20232071.1202996981254"
>
> ------=_Part_3129_20232071.1202996981254
> Content-Type: text/plain; charset=ISO-8859-1
> Content-Transfer-Encoding: 7bit
> Content-Disposition: inline
>
> Hi All,
>
>
> - I have built STL5.1.4 with VC8.
>
>
> - boost against stlport with the following command -> make -
> fvc8-stlport.mak
>
>
> *It created all the necessary libs and dlls. *
>
>
> I have defined the following in my application.
>
> *#define __STL_DEBUG
> #define BOOST_REGEX_DYN_LINK
> *
> But I am still getting the following linker errors. Any one can help me
> with these errors ?
>
> *Appreciate your help in advance*
>
>
> Error 3 error LNK2019: unresolved external symbol
> "__declspec(dllimport) public: __thiscall boost::match_results<char const
> *,class stlp_std::allocator<struct boost::sub_match<char const *> >
>> ::~match_results<char const *,class stlp_std::allocator<struct
> boost::sub_match<char const *> > >(void)" (__imp_??1?$match_results@
> PBDV?$allocator_at_U?$sub_match_at_PBD@boost@@@stlp_std@@@boost@@QAE_at_XZ)
> referenced in function "public: static bool __cdecl
> ExprEvaluator::doesStringMatchRegExpr(char const *,class
> boost::basic_regex<char,struct boost::regex_traits<char,class
> boost::w32_regex_traits<char> > >)" (?doesStringMatchRegExpr_at_ExprEvaluator@@
> SA_NPBDV?$basic_regex_at_DU?$regex_traits_at_DV?$w32_regex_traits_at_D@boost@@@boost@@@boost@@@Z)
> ExprEvaluator.obj
> Error 4 error LNK2019: unresolved external symbol
> "__declspec(dllimport) public: __thiscall boost::match_results<char const
> *,class stlp_std::allocator<struct boost::sub_match<char const *> >
>> ::match_results<char const *,class stlp_std::allocator<struct
> boost::sub_match<char const *> > >(class stlp_std::allocator<struct
> boost::sub_match<char const *> > const &)" (__imp_??0?$match_results@
> PBDV?$allocator_at_U?$sub_match_at_PBD@boost@@@stlp_std@@@boost@@QAE_at_ABV
> ?$allocator_at_U?$sub_match_at_PBD@boost@@@stlp_std@@@Z) referenced in function
> "public: static bool __cdecl ExprEvaluator::doesStringMatchRegExpr(char
> const *,class boost::basic_regex<char,struct boost::regex_traits<char,class
> boost::w32_regex_traits<char> > >)" (?doesStringMatchRegExpr_at_ExprEvaluator@@
> SA_NPBDV?$basic_regex_at_DU?$regex_traits_at_DV?$w32_regex_traits_at_D@boost@@@boost@@@boost@@@Z)
> ExprEvaluator.obj
> Error 5 error LNK2019: unresolved external symbol
> "__declspec(dllimport) public: __thiscall
> boost::re_detail::perl_matcher<char const *,class stlp_std::allocator<struct
> boost::sub_match<char const *> >,struct boost::regex_traits<char,class
> boost::w32_regex_traits<char> > >::~perl_matcher<char const *,class
> stlp_std::allocator<struct boost::sub_match<char const *> >,struct
> boost::regex_traits<char,class boost::w32_regex_traits<char> > >(void)"
> (__imp_??1?$perl_matcher_at_PBDV?$allocator_at_U?$sub_match_at_PBD@boost@@@stlp_std@@
> U?$regex_traits_at_DV?$w32_regex_traits_at_D@boost@@@boost@@@re_detail_at_boost@@
> QAE_at_XZ) referenced in function "bool __cdecl boost::regex_match<char const
> *,class stlp_std::allocator<struct boost::sub_match<char const *>
>> ,char,struct boost::regex_traits<char,class boost::w32_regex_traits<char> >
>> (char const *,char const *,class boost::match_results<char const *,class
> stlp_std::allocator<struct boost::sub_match<char const *> > > &,class
> boost::basic_regex<char,struct boost::regex_traits<char,class
> boost::w32_regex_traits<char> > > const &,enum
> boost::regex_constants::_match_flags)" (??$regex_match_at_PBDV?$allocator_at_U
> ?$sub_match_at_PBD@boost@@@stlp_std@@DU?$regex_traits_at_DV?$w32_regex_traits@
> D_at_boost@@@boost@@@boost@@YA_NPBD0AAV?$match_results_at_PBDV?$allocator@
> U?$sub_match_at_PBD@boost@@@stlp_std@@@0_at_ABV?$basic_regex_at_DU?$regex_traits_at_DV
> ?$w32_regex_traits_at_D@boost@@@boost@@@0_at_W4_match_flags_at_regex_constants_at_0@@Z)
> ExprEvaluator.obj
> Error 6 error LNK2019: unresolved external symbol
> "__declspec(dllimport) public: bool __thiscall
> boost::re_detail::perl_matcher<char const *,class stlp_std::allocator<struct
> boost::sub_match<char const *> >,struct boost::regex_traits<char,class
> boost::w32_regex_traits<char> > >::match(void)"
> (__imp_?match@?$perl_matcher_at_PBDV?$allocator_at_U?$sub_match_at_PBD@boost
> @@@stlp_std@@U?$regex_traits_at_DV?$w32_regex_traits_at_D@boost@@@boost@@@
> re_detail_at_boost@@QAE_NXZ) referenced in function "bool __cdecl
> boost::regex_match<char const *,class stlp_std::allocator<struct
> boost::sub_match<char const *> >,char,struct boost::regex_traits<char,class
> boost::w32_regex_traits<char> > >(char const *,char const *,class
> boost::match_results<char const *,class stlp_std::allocator<struct
> boost::sub_match<char const *> > > &,class boost::basic_regex<char,struct
> boost::regex_traits<char,class boost::w32_regex_traits<char> > > const
> &,enum boost::regex_constants::_match_flags)" (??$regex_match@
> PBDV?$allocator_at_U?$sub_match_at_PBD@boost@@@stlp_std@@DU?$regex_traits_at_DV
> ?$w32_regex_traits_at_D@boost@@@boost@@@boost@@YA_NPBD0AAV?$match_results_at_PBDV
> ?$allocator_at_U?$sub_match_at_PBD@boost@@@stlp_std@@@0_at_ABV?$basic_regex@
> DU?$regex_traits_at_DV?$w32_regex_traits_at_D@boost@@@boost@@@0_at_W4_match_flags@
> regex_constants_at_0@@Z) ExprEvaluator.obj
> Error 7 error LNK2019: unresolved external symbol
> "__declspec(dllimport) public: __thiscall
> boost::re_detail::perl_matcher<char const *,class stlp_std::allocator<struct
> boost::sub_match<char const *> >,struct boost::regex_traits<char,class
> boost::w32_regex_traits<char> > >::perl_matcher<char const *,class
> stlp_std::allocator<struct boost::sub_match<char const *> >,struct
> boost::regex_traits<char,class boost::w32_regex_traits<char> > >(char const
> *,char const *,class boost::match_results<char const *,class
> stlp_std::allocator<struct boost::sub_match<char const *> > > &,class
> boost::basic_regex<char,struct boost::regex_traits<char,class
> boost::w32_regex_traits<char> > > const &,enum
> boost::regex_constants::_match_flags,char const *)"
> (__imp_??0?$perl_matcher_at_PBDV?$allocator_at_U?$sub_match_at_PBD@boost@@@stlp_std@@
> U?$regex_traits_at_DV?$w32_regex_traits_at_D@boost@@@boost@@@re_detail_at_boost@@
> QAE_at_PBD0AAV?$match_results_at_PBDV?$allocator_at_U?$sub_match_at_PBD@boost
> @@@stlp_std@@@2_at_ABV?$basic_regex_at_DU?$regex_traits_at_DV?$w32_regex_traits@
> D_at_boost@@@boost@@@2_at_W4_match_flags_at_regex_constants_at_2@0_at_Z) referenced in
> function "bool __cdecl boost::regex_match<char const *,class
> stlp_std::allocator<struct boost::sub_match<char const *> >,char,struct
> boost::regex_traits<char,class boost::w32_regex_traits<char> > >(char const
> *,char const *,class boost::match_results<char const *,class
> stlp_std::allocator<struct boost::sub_match<char const *> > > &,class
> boost::basic_regex<char,struct boost::regex_traits<char,class
> boost::w32_regex_traits<char> > > const &,enum
> boost::regex_constants::_match_flags)" (??$regex_match_at_PBDV?$allocator_at_U
> ?$sub_match_at_PBD@boost@@@stlp_std@@DU?$regex_traits_at_DV?$w32_regex_traits@
> D_at_boost@@@boost@@@boost@@YA_NPBD0AAV?$match_results_at_PBDV?$allocator@
> U?$sub_match_at_PBD@boost@@@stlp_std@@@0_at_ABV?$basic_regex_at_DU?$regex_traits_at_DV
> ?$w32_regex_traits_at_D@boost@@@boost@@@0_at_W4_match_flags_at_regex_constants_at_0@@Z)
> ExprEvaluator.obj
>
>
> thanks & regards
> Srinivas Chamarthi
>
> ------=_Part_3129_20232071.1202996981254
> Content-Type: text/html; charset=ISO-8859-1
> Content-Transfer-Encoding: quoted-printable
> Content-Disposition: inline
>
> Hi All,<br><br><ul><li>I have built STL5.1.4 with VC8. </li></ul><ul><li>bo=
> Path: news.gmane.org!not-for-mail
> From: Holger Bast <bast_at_[hidden]>
> Newsgroups: gmane.comp.lib.boost.user
> Subject: getline from boost::iostream::filtering_streambuf
> Date: Thu, 14 Feb 2008 08:40:11 +0100
> Lines: 26
> Approved: news_at_[hidden]
> Message-ID: <47B3F05B.9090702_at_[hidden]>
> Reply-To: boost-users_at_[hidden]
> NNTP-Posting-Host: lo.gmane.org
> Mime-Version: 1.0
> Content-Type: text/plain; charset="us-ascii"
> Content-Transfer-Encoding: 7bit
> X-Trace: ger.gmane.org 1202978022 7906 80.91.229.12 (14 Feb 2008 08:33:42 GMT)
> X-Complaints-To: usenet_at_[hidden]
> NNTP-Posting-Date: Thu, 14 Feb 2008 08:33:42 +0000 (UTC)
> Cc: Holger Bast <bast_at_[hidden]>
> To: Boost users <boost-users_at_[hidden]>
> Original-X-From: boost-users-bounces_at_[hidden] Thu Feb 14 09:34:02 2008
> Return-path: <boost-users-bounces_at_[hidden]>
> Envelope-to: yg-boost-users_at_[hidden]
> Original-Received: from wowbagger.osl.iu.edu ([129.79.245.252])
> by lo.gmane.org with esmtp (Exim 4.50)
> id 1JPZXd-0000kR-SV
> for yg-boost-users_at_[hidden]; Thu, 14 Feb 2008 09:34:02 +0100
> Original-Received: from wowbagger.osl.iu.edu (localhost [127.0.0.1])
> by wowbagger.osl.iu.edu (Postfix) with ESMTP id AD17B2F82CB;
> Thu, 14 Feb 2008 03:33:17 -0500 (EST)
> X-Original-To: boost-users_at_[hidden]
> Delivered-To: boost-users_at_[hidden]
> Original-Received: from francois.mpi-sb.mpg.de (mx2.mpi-sb.mpg.de [139.19.1.2])
> by wowbagger.osl.iu.edu (Postfix) with ESMTP id 85B7E2F81AD
> for <boost-users_at_[hidden]>; Thu, 14 Feb 2008 02:40:17 -0500 (EST)
> Original-Received: from loopback.mpi-sb.mpg.de
> ([127.0.0.1]:38698 helo=localhost ident=amavis)
> by francois.mpi-sb.mpg.de (envelope-from <bast_at_[hidden]>)
> with esmtp (Exim 4.50) id 1JPYhc-0006E8-0z
> for boost-users_at_[hidden]; Thu, 14 Feb 2008 08:40:16 +0100
> Original-Received: from francois.mpi-sb.mpg.de ([127.0.0.1])
> by localhost (aspirin.mpi-sb.mpg.de [127.0.0.1]) (amavisd-new,
> port 10024) with ESMTP id 23550-05 for <boost-users_at_[hidden]>;
> Thu, 14 Feb 2008 08:40:15 +0100 (CET)
> Original-Received: from infao0710.mpi-sb.mpg.de ([139.19.1.28]:51092
> helo=newzak.mpi-sb.mpg.de)
> by francois.mpi-sb.mpg.de (envelope-from <bast_at_[hidden]>)
> with esmtp (Exim 4.50) id 1JPYhY-0006DY-7g;
> Thu, 14 Feb 2008 08:40:12 +0100
> Original-Received: from p54a5de01.dip.t-dialin.net ([84.165.222.1]:64595
> helo=[192.168.2.24]) by newzak.mpi-sb.mpg.de with esmtpsa
> (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63)
> (envelope-from <bast_at_[hidden]>)
> id 1JPYhX-0000lh-Rv; Thu, 14 Feb 2008 08:40:12 +0100
> X-Notes-Item: NOT CHECKED;
> name=$DNSBLSite
> User-Agent: Thunderbird 1.5.0.14 (Windows/20071210)
> X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at mpi-sb.mpg.de
> X-Mailman-Approved-At: Thu, 14 Feb 2008 03:32:11 -0500
> X-BeenThere: boost-users_at_[hidden]
> X-Mailman-Version: 2.1.9
> Precedence: list
> List-Id: Boost Users mailing list <boost-users.lists.boost.org>
> List-Unsubscribe: <http://lists.boost.org/mailman/listinfo.cgi/boost-users>,
> <mailto:boost-users-request_at_[hidden]?subject=unsubscribe>
> List-Archive: <http://lists.boost.org/MailArchives/boost-users>
> List-Post: <mailto:boost-users_at_[hidden]>
> List-Help: <mailto:boost-users-request_at_[hidden]?subject=help>
> List-Subscribe: <http://lists.boost.org/mailman/listinfo.cgi/boost-users>,
> <mailto:boost-users-request_at_[hidden]?subject=subscribe>
> Original-Sender: boost-users-bounces_at_[hidden]
> Errors-To: boost-users-bounces_at_[hidden]
> Xref: news.gmane.org gmane.comp.lib.boost.user:33455
> Archived-At: <http://permalink.gmane.org/gmane.comp.lib.boost.user/33455>
>
> I want to read line by line from a gzipped document.
>
> I first do:
>
> std::ifstream file(fileName.c_str());
> boost::iostreams::filtering_streambuf<boost::iostreams::input> in;
> in.push(boost::iostreams::gzip_decompressor());
> in.push(documentFile);
>
> However, then the obvious:
>
> string line;
> while(std::getline(in, line)) { ... }
>
> does not compile.
>
> Is there really no getline for filtering_streambuf?

getline() is provided by the C++ standard library for use with input
streams. The above should compile if you use filtering_stream instead of
filtering_streambuf (and possibly make some unrelated changes -- e.g.,
it doesn't look like "documentFile" is defined).

> If not, what is the best way to write one?

You shouldn't need to.

> I tried reading character by character using boost::iostream::get(in)
> but that looks terribly inefficient to me, and is not nice code.

boost::iostreams::get() just calls streambuf::sgetc() in this case. It
is just as efficient as calling sgetc() directly, if you are using an
optimizing compiler.

> Thanks for your help,
>
> Holger

-- 
Jonathan Turkanis
CodeRage
http://www.coderage.com

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