c++ - gcc linker errors when using boost to_lower & trim -


text after "itemprop =" text ">

I use the boost library in my code but Sparc Solaris is trying to get the following linker errors under the forum.

The problem code can be summarily summarized as follows:

  #include & lt; Boost / algorithm / string.hpp & gt; Std :: string xparam; ... xparam = boost :: to_lower (xparam);  

The linkir error is:

  LdapClient.cc:349: no match for 'std :: string & amp; = ZERO 'operator /opt/gcc-3.2.3/include/c++/3.2.3/bits/basic_string.h:338: The candidates are: std :: basic_string & LT; _CharT, _Traits, _Alloc & gt; & Amp; Std :: basic_string & lt; _CharT, _Traits, _Alloc & gt; :: operator = (constants std :: basic_string & lt; _CharT, _Traits, _Alloc & gt; & amp;) [with _CharT = four, _Traits = std :: char_traits & lt; Four & gt ;, _Alloc = STD :: Opposite & LT; Four>] /opt/gcc-3.2.3/include/c++/3.2.3/bits/basic_string.h:341: std :: basic_string & lt; _CharT, _Traits, _Alloc & gt; & Amp; Std :: basic_string & lt; _CharT, _Traits, _Alloc & gt; :: operator = (const _CharT *) [_CharT = four, _Traits = std :: char_traits & lt; Char & gt ;, _Alloc = std :: allocation & lt; Char & gt;] / opt / gcc with -3.2.3 / include / c ++ / 3.2.3 / bits / basic_string.h: 344: std :: basic_string & lt; _CharT, _Traits, _Alloc & gt; & Amp; Std :: basic_string & lt; _CharT, _Traits, _Alloc & gt; :: operator = (_ CharT) [_CharT = char, _Traits = std :: char_traits & lt; Char & gt ;, _Alloc = std :: allocator & lt; Char & gt;] with: *** [LdapClient.o] Error 1  

Any ideas?

does not return the copy of the string, it runs on the variable run in the function. For some examples ,.

There is no need to reassign:

  boost :: to_lower (xparam);  

You will get an error because you are trying to assign the string to the value Zero .

For this, if you want to make a copy, use the copy version:

  std :: string xparamLowed = boost :: to_lower_copy (xparam);  

Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -