Adding Bonjour (dns_sd.h) library to Qt in Windows -


i've been trying add open source dns_sd.h library provided apple. writing program uses bonjourregistrar class demonstrated here: link text

i've written program on mac environment , trying port windows. bonjour sdk comes several classes, , quite confused onto how correctly add class qt project. have tried add line:

win32:libs += c:\dnsssd.lib 

in .pro file no success. also, attempted add dns_sd.h , dns_sd.c files project , got couple of errors such as:

'uint8': not name type 'int8': not name type 'uint16' not name type 'int16' not name type

finally, trying modify lib file described xcimo in link link text

i not know if using correct command modify these files.

the .lib distributed apple can used if compiling qt application msvc compiler.

otherwise, said, need gcc-compatible library (.a). need following steps:

  1. run reimp tool [0] on .lib: reimp dnssd.lib. file dllstub.obj generated.
  2. run gendef tool [1] on .dll: gendef dnssd.dll. file dnssd.def generated. .dll can obtained from: c:\windows\system32 if using 32 bit or c:\windows\syswow64 64 bit version.
  3. assemble final .a: dlltool -k -d dnssd.def -l libdnssd.a.
  4. add right path int .pro file, newly created library: libs += -l"/path/to/the/library/file" -ldnssd

[0] - http://sourceforge.net/projects/mingw/files/mingw/extension/mingw-utils/mingw-utils-0.4-1/

[1] - http://sourceforge.net/projects/mingw/files/mingw/extension/gendef/gendef-1.0.1346/ - gendef better alternative pexports, because can convert stdcall-type libraries msvc gcc ones, can proper .def file.

ps: know author got working, felt there should more detailed instructions on how done -- information scattered around internet.


Comments

Popular posts from this blog

Add email recipient to all new Trac tickets -

400 Bad Request on Apache/PHP AddHandler wrapper -

php - Change action and image src url's with jQuery -