c++ - Visual C++ LNK2028 和 LNK2019 错误
问题描述
这是我试图在 Visual Studio 2017 中编译的代码。
#include "stdafx.h"
#define _WINSOCKAPI_
#include <httpserv.h>
#include "json.h"
#include "json-forwards.h"
#include <iostream>
#include <fstream>
HRESULT
__stdcall
RegisterModule(DWORD dwServerVersion, IHttpModuleRegistrationInfo * pModuleInfo, IHttpServer * pGlobalInfo)
{
UNREFERENCED_PARAMETER(dwServerVersion);
UNREFERENCED_PARAMETER(pGlobalInfo);
bool alive = true;
MyGlobalModule * pGlobalModule = new MyGlobalModule;
if (NULL == pGlobalModule)
{
return HRESULT_FROM_WIN32(ERROR_NOT_ENOUGH_MEMORY);
}
while (alive) {
Json::Reader reader;
Json::Value root;
std::ifstream push_manifest("push_manifest.json", std::ifstream::binary);
bool parsingSuccessful = reader.parse(push_manifest, root, false);
if (!parsingSuccessful)
{
// report to the user the failure and their locations in the document.
std::cout << reader.getFormatedErrorMessages()
<< "\n";
}
std::string encoding = root.get("encoding", "UTF-8").asString();
std::cout << encoding << "\n";
alive = false;
}
return pModuleInfo->SetGlobalNotifications(
pGlobalModule, GL_PRE_BEGIN_REQUEST);
}
编译时出现以下错误。请提出错误,因为错误没有解释任何内容。
解决方案
推荐阅读
- database - Enabling MongoDB transactions without replica sets or with least possible configuration
- android - 在不使用显式 Job() 对象的情况下取消父作业
- python - 将硒与python链接不起作用?
- html - 如何在没有 {css} 的情况下将文本放在图像下方
- java - 从 Mongo 查询格式到 java 的投影
- django - 通过覆盖 save 规避 django-simple-history 的 F 表达式问题
- java - 如何使用 PDFBox 使用标题字体大小阅读 PDF 部分?
- java - 从 Java、android 调用 Kotlin?
- python - 在同一个域上使用 Django 租户,而不是子域或多个域
- android - Android 11 中的 TypedValue.applyDimension() 返回奇怪的值