[prev in list] [next in list] [prev in thread] [next in thread]
List: boost-users
Subject: [Boost-users] [coroutine] MinGW: terminate called after throwing an instance of 'boost::context::det
From: Jan Niklas Hasse via Boost-users <boost-users () lists ! boost ! org>
Date: 2017-10-13 18:49:08
Message-ID: 1507920548.2617623.1138057760.483863A0 () webmail ! messagingengine ! com
[Download RAW message or body]
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 mailing list
Boost-users@lists.boost.org
https://lists.boost.org/mailman/listinfo.cgi/boost-users
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic