Msgstr "Compiler streaming support not included."

Usually I can google find the way and find solutions, but not this time.

I am using 64-bit Linux Ubuntu 11.04 to compile a 32-bit windowed application. I am using i586-mingw32msvc-gcc to compile my files in C ++.

test.cpp:

#include <boost/asio.hpp> 

Makefile:

 i586-mingw32msvc-gcc -c -m32 -mthreads -o test.o test.cpp 

Error:

 boost/asio/detail/socket_types.hpp: # include <sys/ioctl.h> doesn't exist. 

Added to makefile: -DBOOST_WINDOWS

 Error: # warning Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately 

Good, added to makefile: -D_WIN32_WINNT = 0x0501

 Error: # error "Compiler threading support is not turned on. Please set the correct command line options for threading: -pthread (Linux), -pthreads (Solaris) or -mthreads (Mingw32)" 

However, I specified -mthreads.

+6
source share
3 answers

It turned out that I had a set of #undef and #defines to force the GLIBC version to something that allowed me to compile for Linux (rather than cross-compile) RHEL5, which otherwise would give me all kinds of other errors. It turns out that when cross-compiling for windows using mingw, this force serving the GLIBC version causes amplification for the strange way, leaving various aspects undefined, including bahavior or streaming availability. I surrounded it with #ifndef _WIN32, which is why the problem disappeared.

+1
source

Adding -DBOOST_HAS_THREADS may be sufficient (see # elif defined __GNUC__ from the violating header ). But it is likely / possible that your expedited installation was created to support your build environment, and not for your purpose. Try creating it yourself using your cross compiling toolchain.

+2
source

It is possible that the -mthreads argument should be the last.

0
source

Source: https://habr.com/ru/post/900973/


All Articles