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:
- run reimp tool [0] on .lib:
reimp dnssd.lib. filedllstub.objgenerated. - run gendef tool [1] on .dll:
gendef dnssd.dll. filednssd.defgenerated. .dll can obtained from:c:\windows\system32if using 32 bit orc:\windows\syswow6464 bit version. - assemble final .a:
dlltool -k -d dnssd.def -l libdnssd.a. - 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
Post a Comment