【发布时间】:2014-08-12 16:38:22
【问题描述】:
这是一个 zeroconf example 我正在尝试在 Windows 上编译。我还从 Apple 下载了bonjour sdk for Windows 。
我正在使用 Qt 版本 (4.6.2) 和 Qt Creator 1.3.1,不确定是否相关。
当我编译时,它抱怨“UINT8”没有在 dns_sd.h 中命名类型。我尝试在 dns_sd.h 之前包含 stdint.h,如下所示:
#include <stdint.h>
#include <dns_sd.h>
但是 QT 仍然抱怨同样的错误。即使我进入 stdint.h 并且有一个 uint8_t 的声明。
This post 建议将 .lib 转换为 .a,因为我们无法将 gcc 程序链接到 MSVC lib。我试过了,但没有解决问题。这是.pro文件
HEADERS = client.h \
bonjourservicebrowser.h \
bonjourserviceresolver.h
SOURCES = client.cpp \
main.cpp \
bonjourservicebrowser.cpp \
bonjourserviceresolver.cpp
QT += network
!mac:x11:LIBS+=-ldns_sd
win32:LIBS+=-ldnssd
LIBPATH += "C:/Tools/reimp_new/bin"
INCLUDEPATH += "C:/Program Files/Bonjour SDK/Include"
我把libdnssd.a放在C:\Tools\reimp_new\bin的路径下。
错误仍在发生:(
【问题讨论】:
标签: windows qt bonjour zeroconf