相关疑难解决方法(0)

使用 C++ 和 bcrypt 头时出现编译错误

我正在尝试测试 Windows Bcrypt。我有一个测试程序:

#include <bcrypt.h>
#include <iostream>
#include <string>

#pragma comment (lib, "bcrypt.lib")

int main(int argc, char* argv[])
{
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

尝试编译它:

>cl.exe /DWINVER=0x0600 /TP /GR /EHsc bcrypt-test.cpp /link /out:bcrypt-test.exe
Microsoft (R) C/C++ Optimizing Compiler Version 19.00.24210 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

bcrypt-test.cpp
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared\bcrypt.h(39):
 error C2059: syntax error: 'return'
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared\bcrypt.h(40):
 error C2143: syntax error: missing ';' before '*'
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared\bcrypt.h(40):
 error C4430: missing type specifier - int …
Run Code Online (Sandbox Code Playgroud)

c++ windows compiler-errors cng

3
推荐指数
1
解决办法
3678
查看次数

标签 统计

c++ ×1

cng ×1

compiler-errors ×1

windows ×1