Qt <winInet.h> 在构建时输出许多 C4430 和 C2146 错误

Qt <winInet.h> outputs many C4430 & C2146 Errors on build

List of Errors

我想我已经在此处的 QT 项目文件中包含了 winInet.h 的库:​​

project.pro

QT += qml quick network

CONFIG += c++11

SOURCES += main.cpp \
xmap.cpp

RESOURCES += qml.qrc

LIBS += -lwininet

每次我尝试 qmake 并构建头文件时都会显示许多语法错误,我很好奇这是否是因为我的 qt 项目文件语法错误。

xmap.h

#ifndef XMAP_H
#define XMAP_H

#include <iostream>
#include <WinInet.h>    // <--- ISSUE
#include <Windows.h>
#include <time.h>

class xmap
{
public:
xmap();

// test connection to websites for data
 int CheckConnection(int connection = 0);

// pull data from online sources to be evaluated by the model
void RequestAndSaveData(std::string filename);


};

#endif // XMAP_H

与 基本相同,只是使用的是 WinHttp 而不是 WinInet。

仍然是相同的解决方案:包括 <Windows.h> before <WinInet.h>.