Code Monkey home page Code Monkey logo

mdns_cpp's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

mdns_cpp's Issues

mdns_cpp: Compile error when building with MSYS2/MINGW.

When I try to build mdns_cpp on Windows with MSYS2/MINGW it fails with the following output:

$ cmake --build .
[ 10%] Building CXX object CMakeFiles/mdns_cpp.dir/src/logger.cpp.obj
[ 20%] Building CXX object CMakeFiles/mdns_cpp.dir/src/mdns.cpp.obj
C:\msys64\home\david\projects\mdns_cpp-master\src\mdns.cpp: In member function 'int mdns_cpp::mDNS::openServiceSockets(int*, int)':
C:\msys64\home\david\projects\mdns_cpp-master\src\mdns.cpp:38:26: error: 'in4addr_any' was not declared in this scope; did you mean 'in6addr_any'?
   38 |     sock_addr.sin_addr = in4addr_any;
      |                          ^~~~~~~~~~~
      |                          in6addr_any
mingw32-make[2]: *** [CMakeFiles\mdns_cpp.dir\build.make:91: CMakeFiles/mdns_cpp.dir/src/mdns.cpp.obj] Error 1
mingw32-make[1]: *** [CMakeFiles\Makefile2:88: CMakeFiles/mdns_cpp.dir/all] Error 2
mingw32-make: *** [Makefile:135: all] Error 2

The following patch removed the error and the mdns_cpp build succeeded. And the example programs seem to work as expected.

--- mdns.cpp.original 2022-09-07 14:22:48.000000000 +0800
+++ mdns.cpp  2023-08-10 21:23:03.502663800 +0800
@@ -35,7 +35,7 @@
     sockaddr_in sock_addr{};
     sock_addr.sin_family = AF_INET;
 #ifdef _WIN32
-    sock_addr.sin_addr = in4addr_any;
+    sock_addr.sin_addr.s_addr = INADDR_ANY;
 #else
     sock_addr.sin_addr.s_addr = INADDR_ANY;
 #endif

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.