Simple example program builds but hangs when I run it. (Ubuntu).
Hello,
I run Ubuntu 11.04. I downloaded Boost 1.48.0, then I followed the
instructions from Getting Started on Unix variants to build the libraries
into /usr/local/include and /usr/local/lib. Now, I build the Simple example
program without any errors, however
when I run the program it just hangs indefinitely on std::for_each() line.
Could someone help me with this please?
$: g++ -g -lboost_filesystem main.cpp
#include
On Tuesday 24 January 2012 03:43:13 vincegata wrote:
#include
#include <iostream> #include <iterator> #include <algorithm> int main() { using namespace boost::lambda; typedef std::istream_iterator<int> in;
std::for_each(in(std::cin), in(), std::cout << (_1 * 3) << " " ); int stop = 1; } It's easy. It reads until end of stdin. Press C-d? Correct behavior to me. Or I missed somthing and it don't response to you with trippled number?
Best regards, illusionoflife
On 01/23/12 17:43, vincegata wrote:
Hello,
I run Ubuntu 11.04. I downloaded Boost 1.48.0, then I followed the instructions from Getting Started on Unix variants to build the libraries into /usr/local/include and /usr/local/lib. Now, I build the Simple example program without any errors, however when I run the program it just hangs indefinitely on std::for_each() line.
Could someone help me with this please?
$: g++ -g -lboost_filesystem main.cpp
#include
#include <iostream> #include <iterator> #include <algorithm> int main() { using namespace boost::lambda; typedef std::istream_iterator<int> in;
std::for_each(in(std::cin), in(), std::cout << (_1 * 3) << " " ); int stop = 1; }
What's in std::cin? What output do you expect to see? -regards, Larry
That was a problem with Qt Creator not communicating with gdb. Thank you
for your replies.
SOLVED.
On Tue, Jan 24, 2012 at 7:28 AM, Larry Evans
Hello,
I run Ubuntu 11.04. I downloaded Boost 1.48.0, then I followed the instructions from Getting Started on Unix variants to build the libraries into /usr/local/include and /usr/local/lib. Now, I build the Simple example program without any errors, however when I run the program it just hangs indefinitely on std::for_each()
On 01/23/12 17:43, vincegata wrote: line.
Could someone help me with this please?
$: g++ -g -lboost_filesystem main.cpp
#include
#include <iostream> #include <iterator> #include <algorithm> int main() { using namespace boost::lambda; typedef std::istream_iterator<int> in;
std::for_each(in(std::cin), in(), std::cout << (_1 * 3) << " " ); int stop = 1; }
What's in std::cin? What output do you expect to see?
-regards, Larry
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (3)
-
ilusionoflife
-
Larry Evans
-
vincegata