I am trying to use boost.asio in my C++ project, using Cygwin 64-bit. However, even a program as simple as this:
// compiled by: g++ -g -std=c++11 -D_XOPEN_SOURCE=500 -c -o build/server.o src/server.cpp
#include <boost/asio.hpp>
int main(int argc, const char** argv) {
return 0;
}
Causes a large stream of error messages. GCC complains that it cannot find symbols like EAI_SERVICE
, getaddrinfo
, or host_name
. The full error log can be found here: https://pastebin.com/RwpX3bx3
In this question here, it is suggested that I add -D_XOPEN_SOURCE=500
to the command line. But, as you can see, I do compile it with -D_XOPEN_SOURCE=500
, and it doesn't work. I've also tried uninstalling and reinstalling libboost-devel
through the Cygwin installer, but that also did not work.
(EDIT: No, it doesn't work without -D_XOPEN_SOURCE=500
, either. Without it, you get this: https://pastebin.com/AExBa2pL)
What's going wrong here?