Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VS编译标准示例报错无法解析的外部符号 #28

Open
UnknownObject000 opened this issue Feb 11, 2022 · 1 comment
Open

VS编译标准示例报错无法解析的外部符号 #28

UnknownObject000 opened this issue Feb 11, 2022 · 1 comment

Comments

@UnknownObject000
Copy link

我复制了Readme中的完整客户端例子到VS项目中编译,出现”LNK2001 无法解析的外部符号“错误.(服务端代码不会引起这个错误)
以下为错误内容:

已启动重新生成…
1>------ 已启动全部重新生成: 项目: Application Communication Interface, 配置: Release x64 ------
1>Application Communication Interface.cpp
1>Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately. For example:
1>- add -D_WIN32_WINNT=0x0601 to the compiler command line; or
1>- add _WIN32_WINNT=0x0601 to your project's Preprocessor Definitions.
1>Assuming _WIN32_WINNT=0x0601 (i.e. Windows 7 target).
1>webcc.lib(client_session.obj) : error LNK2001: 无法解析的外部符号 __imp_CertCloseStore
1>webcc.lib(client_session.obj) : error LNK2001: 无法解析的外部符号 __imp_CertEnumCertificatesInStore
1>webcc.lib(client_session.obj) : error LNK2001: 无法解析的外部符号 __imp_CertFreeCertificateContext
1>webcc.lib(client_session.obj) : error LNK2001: 无法解析的外部符号 __imp_CertOpenSystemStoreW
1>F:\Application Communication Interface\x64\Release\Application Communication Interface.exe : fatal error LNK1120: 4 个无法解析的外部命令
1>已完成生成项目“Application Communication Interface.vcxproj”的操作 - 失败。
========== 全部重新生成: 成功 0 个,失败 1 个,跳过 0 个 ==========

Projects build report:
  Status    | Project [Config|platform]
 -----------|---------------------------------------------------------------------------------------------------
  Failed    | Application Communication Interface\Application Communication Interface.vcxproj [Release|x64]

Build time 00:00:03.553
Build ended at 2022-02-11 14:53:31

图为VS的“错误列表”
image

@sprinfall
Copy link
Owner

sprinfall commented Feb 15, 2022

因为你没有用 CMake,有些库得自己指定一下,你这个问题只要链接 Crypt32.lib 就可以了。
我今天改一下吧,在代码里直接用 #pragma 来指定 Crypt32.lib。

Update: 我还是决定不这样改了,还是建议你使用 CMake 构建你自己的项目,然后参照 webcc-integration 来集成。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants