Skip to content

windows usage #2

@fuxey

Description

@fuxey

Hi, i am using this lib for linux, no prob works great! (i have several avahi linux devices)
for windows there are some things to change:

  • INADDR_BROADCAST (255.255.255.255) is for some reason not working, use Multicast address instead: inet_addr ("224.0.0.1"); or use the local broadcast address: e.g.: inet_addr("192.168.1.255)

if you want to compile it with mingw (e.g.: Qt Creator)

  • add target_link_libraries(basic_demo ws2_32 wsock32) in CMakeFile
  • add in the basic_demo/main.cpp
    #define _WIN32_WINNT _WIN32_WINNT_WIN10
    #include <Ws2tcpip.h>
    #include <w32api.h>

maybe someone can explain to me why the 255.255.255.255 broadcast address is not working, but the local broadcast 192.168.1.255 or the multicast 224.0.0.1 is working?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions