|
Boost Users : |
Subject: [Boost-users] [coroutine] MinGW: terminate called after throwing an instance of 'boost::context::detail::forced_unwind'
From: Jan Niklas Hasse (jhasse_at_[hidden])
Date: 2017-10-13 18:49:08
Hi :)
I've tried to compile this simple Boost.Coroutine example:
#include <iostream>
#include <boost/coroutine2/all.hpp>
void foo(boost::coroutines2::asymmetric_coroutine<void>::push_type& yield) {
for (int i = 0; i < 10; ++i) {
std::cout << i << std::endl;
yield();
}
}
int main() {
boost::coroutines2::asymmetric_coroutine<void>::pull_type coroutine(foo);
for (int i = 0; i < 5; ++i) {
coroutine();
}
}
On Linux this works as expected, just as on Windows with Visual Studio. But when I cross-compile on Linux using
i686-w64-mingw32-g++ src/main.cpp -lboost_context-mt
The resulting exe crashes with:
0
1
2
3
4
5
6
terminate called after throwing an instance of 'boost::context::detail::forced_unwind'
abnormal program termination
There's a similar problem on StackOverflow: https://stackoverflow.com/questions/45569418/how-to-use-boost-context-correctly
But I'm having the crash only with the cross-compiled version, not MSVC. Am I doing something wrong? Or might this be a bug in Fedora's mingw32-boost package?
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