Results 1 to 4 of 4

Thread: Howto use Qt with Boost ?

  1. #1
    Join Date
    Oct 2009
    Posts
    4
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Howto use Qt with Boost ?

    Hello all,

    I am using Qt on Windows with MinGW. I added boost library by using INCLUDEPATH in the .pro file and compiled the sample program from boost's Getting Started on Windows.

    using namespace boost::lambda;
    typedef std::istream_iterator<int> in;

    std::for_each(
    in(std::cin), in(), std::cout << (_1 * 3) << " " );

    Now I receive the errors:
    error: `cin' is not a member of `std'
    error: `cout' is not a member of `std'

    Do namespaces std and boost interfere?
    Can I find a tutorial howto use Qt with Boost somewhere?

  2. #2
    Join Date
    Sep 2009
    Posts
    140
    Thanks
    4
    Thanked 17 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Howto use Qt with Boost ?

    There is no problem using std neither boost with Qt. Just a question of includes and link.

    In your sample, be sure to include <iostream> and <algorithm>

  3. The following user says thank you to scascio for this useful post:

    bilgenratte (1st October 2009)

  4. #3
    Join Date
    Oct 2009
    Posts
    4
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Howto use Qt with Boost ?

    Ok, I focused so much on boost, that I forgot the includes, SORRY for that !!!

  5. #4
    Join Date
    Dec 2006
    Posts
    849
    Thanks
    6
    Thanked 163 Times in 151 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Howto use Qt with Boost ?

    unless you want to use Boost.Signals, then you need to specify in your .pro file
    Qt Code:
    1. CONFIG += no_keywords // for Boost.Signals
    To copy to clipboard, switch view to plain text mode 

    and use Q_SIGNALS, S_SLOTS, Q_EMIT etc instead of signals, slots, emit...

    HTH

Similar Threads

  1. Replies: 0
    Last Post: 25th June 2009, 09:17
  2. how to use boost multi_array in QtCreator
    By elflord in forum Qt Programming
    Replies: 2
    Last Post: 1st April 2009, 08:37
  3. Qt + boost + MinGW on Windows
    By akos.maroy in forum Newbie
    Replies: 3
    Last Post: 12th June 2008, 15:53
  4. Error compiling Qt3 app with Boost signals support
    By stodge in forum Qt Programming
    Replies: 3
    Last Post: 3rd May 2007, 11:48
  5. Howto use Eclipse with QT4 in 10 steps
    By the_bis in forum Newbie
    Replies: 3
    Last Post: 28th January 2007, 21:21

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.