gpt4 book ai didi

c++ - 在 MFC 应用程序中使用 wininet 和 winhttp 编译错误

转载 作者:搜寻专家 更新时间:2023-10-31 01:23:19 25 4
gpt4 key购买 nike

奇怪的是我以前有这个工作,但我重新安装了我的系统,升级到 w7,现在我似乎无法编译这段代码。

问题是我在我的大部分应用程序中都使用 winhttp.h,但我有一个简单的 FTP 客户端对象,它是我使用 wininet.h 功能编写的。我现在似乎无法让应用程序编译,无论我如何/在何处包含哪些 header 。

目前我的 stdafx.h 中有:

#include <winhttp.h>

在我的 ftp 客户端 .c 中

#include <wininet.h>

除了失败的 FTP 客户端对象之外,这会成功编译所有对象:

c:\Program Files\Microsoft Platform SDK\Include\WinInet.h(52) : warning C4005: 'BOOLAPI' : macro redefinition c:\Program Files\Microsoft Platform SDK\Include\winhttp.h(45) : see previous definition of 'BOOLAPI' c:\Program Files\Microsoft Platform SDK\Include\WinInet.h(270) : error C2143: syntax error : missing '}' before '(' c:\Program Files\Microsoft Platform SDK\Include\WinInet.h(270) : fatal error C1903: unable to recover from previous error(s); stopping compilation

有什么建议吗?

最佳答案

啊知道了,最后通过将 winhttp 包含移动到 cpp 文件并将 wininet 放入 ft​​p 客户端 header 。

关于c++ - 在 MFC 应用程序中使用 wininet 和 winhttp 编译错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1650964/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com