Boost Compilation

Discussion in 'C++' started by Travis, Feb 22, 2008.

  1. Travis

    Travis Guest

    I'm using the compare libraries for the first time (http://
    www.boost.org/doc/html/string_algo/reference.html#header.boost.algorithm.string.compare.hpp).
    I guess I'm not including the right thing because I can't get certain
    functions to work.

    This works....

    #include <iomanip>
    #include <iostream>
    #include <string>

    #include <boost/algorithm/string/compare.hpp>

    using namespace std;
    using namespace boost;

    boost::is_equal IsEqual;

    int main()
    {
    // inital output
    string First;
    string Second;

    cout << "String 1: ";
    cin >> First;
    cout << "String 2: ";
    cin >> Second;

    string IsEqualResult = IsEqual(First,Second) ? "yes" : "no";

    cout << "IsEqual = " << IsEqualResult << endl;

    return 0;
    }

    But changing it to use boost::is_iequal, boost::is_less, etc. doesn't
    seem to compile. I'm not sure what I'm missing from the documentation,
    I think I'm including everything necessary.
    Travis, Feb 22, 2008
    #1
    1. Advertising

  2. Travis wrote:
    > I'm using the compare libraries for the first time (http://
    > www.boost.org/doc/html/string_algo/reference.html#header.boost.algorithm.string.compare.hpp).
    > I guess I'm not including the right thing because I can't get certain
    > functions to work.
    >
    > This works....
    >
    > #include <iomanip>
    > #include <iostream>
    > #include <string>
    >
    > #include <boost/algorithm/string/compare.hpp>
    >
    > using namespace std;
    > using namespace boost;
    >
    > boost::is_equal IsEqual;
    >
    > int main()
    > {
    > // inital output
    > string First;
    > string Second;
    >
    > cout << "String 1: ";
    > cin >> First;
    > cout << "String 2: ";
    > cin >> Second;
    >
    > string IsEqualResult = IsEqual(First,Second) ? "yes" : "no";
    >
    > cout << "IsEqual = " << IsEqualResult << endl;
    >
    > return 0;
    > }
    >
    > But changing it to use boost::is_iequal, boost::is_less, etc. doesn't
    > seem to compile.


    "Doesn't seem"? Are you unsure? What "seems" to be the problem?
    What messages do you get from your compiler? Why do I have to pull
    it out of you?

    BTW, do you know of the existence of Boost online forums? They are
    right there, on their web site...

    > I'm not sure what I'm missing from the documentation,
    > I think I'm including everything necessary.


    V
    --
    Please remove capital 'A's when replying by e-mail
    I do not respond to top-posted replies, please don't ask
    Victor Bazarov, Feb 22, 2008
    #2
    1. Advertising

  3. Travis

    Travis Guest

    On Feb 22, 10:39 am, "Victor Bazarov" <> wrote:
    > Travis wrote:
    > > I'm using the compare libraries for the first time (http://
    > >www.boost.org/doc/html/string_algo/reference.html#header.boost.algori...).
    > > I guess I'm not including the right thing because I can't get certain
    > > functions to work.

    >
    > > This works....

    >
    > > #include <iomanip>
    > > #include <iostream>
    > > #include <string>

    >
    > > #include <boost/algorithm/string/compare.hpp>

    >
    > > using namespace std;
    > > using namespace boost;

    >
    > > boost::is_equal IsEqual;

    >
    > > int main()
    > > {
    > > // inital output
    > > string First;
    > > string Second;

    >
    > > cout << "String 1: ";
    > > cin >> First;
    > > cout << "String 2: ";
    > > cin >> Second;

    >
    > > string IsEqualResult = IsEqual(First,Second) ? "yes" : "no";

    >
    > > cout << "IsEqual = " << IsEqualResult << endl;

    >
    > > return 0;
    > > }

    >
    > > But changing it to use boost::is_iequal, boost::is_less, etc. doesn't
    > > seem to compile.

    >
    > "Doesn't seem"? Are you unsure? What "seems" to be the problem?
    > What messages do you get from your compiler? Why do I have to pull
    > it out of you?
    >
    > BTW, do you know of the existence of Boost online forums? They are
    > right there, on their web site...
    >
    > > I'm not sure what I'm missing from the documentation,
    > > I think I'm including everything necessary.

    >
    > V
    > --
    > Please remove capital 'A's when replying by e-mail
    > I do not respond to top-posted replies, please don't ask


    Thanks for the info. I won't bother clarifying the "seems". I'll move
    the topic to a more useful forum. Thanks.
    Travis, Feb 22, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Richard Latter
    Replies:
    2
    Views:
    2,887
    Julie
    May 17, 2004
  2. Steve Knight
    Replies:
    2
    Views:
    743
    Steve Knight
    Oct 10, 2003
  3. Toby Bradshaw
    Replies:
    6
    Views:
    1,723
    Kai-Uwe Bux
    Jun 2, 2006
  4. Colin Caughie
    Replies:
    1
    Views:
    694
    Shooting
    Aug 29, 2006
  5. Misiu
    Replies:
    3
    Views:
    2,352
    Misiu
    Jan 31, 2007
Loading...

Share This Page