1

How to Build a C++ program that is using libev on Windows 10 using MinGW. Can any body tell me how to compile and link to a sample program that is using libev on Windows 10. I am successful to run our c++ program on linux and want to make it work on windows also. Do i need cygwin also for it or MinGW is enough for this purpose. Please tell the way and tools needed for doing it on Windows 10

  • Possible duplicate of [SO: Libev on Windows](https://stackoverflow.com/q/8042796/7478597) – Scheff's Cat Oct 24 '17 at 05:33
  • Probably a helpful doc. on CPAN: [WIN32 PLATFORM LIMITATIONS AND WORKAROUNDS](http://search.cpan.org/dist/EV/libev/ev.pod#WIN32_PLATFORM_LIMITATIONS_AND_WORKAROUNDS) – Scheff's Cat Oct 24 '17 at 05:36

1 Answers1

0

Scheff, Thanks for guiding me to overcome my problem with the correct link you have shared. To explain more clearly, embedding the project means, copy libev files to a libev folder and don't include them in project solution. Just make them available to source code by having a libev folder and libev source and header files in them. Don't even list this libev folder in project solution. Just include evwrap.h and evwrap.c in project solution. and in source code instead of ev.h, replace that line with evwrap.h file. After doing the steps as in the CPAN, I got compilation errors. I added the precompilation options _CRT_NONSTDC_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS; in VS 2015, and in code add this line #pragma comment(lib, "ws2_32.lib"), After that it linked to select model of socket programming in windows. But at runtime, it crashed. because we need to initialise win sock library. so I added below lines #include #include

include WORD wVersionRequested;

WSADATA wsaData;  wVersionRequested = MAKEWORD(2, 2);int err = WSAStartup(wVersionRequested, &wsaData);

And the issue is resolved.