我想我已经将winInet.h的库包含在QT项目文件中了:
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
答案 0 :(得分:1)
基本上与C++ 307 Errors when trying to include winhttp.h in visual studio 2010相同,除了使用WinHttp而不是WinInet。
同样的解决方案:在 ln -s /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/bin/python2.7 /usr/local/bin/python
之前添加<Windows.h>
。