错误:

error LNK2001: 无法解析的外部符号 __imp__OpenProcessToken@12

error LNK2001: 无法解析的外部符号 __imp__LookupPrivilegeValueA@12

error LNK2001: 无法解析的外部符号 __imp__AdjustTokenPrivileges@24

error LNK2001: 无法解析的外部符号 __imp__OpenSCManagerA@12

error LNK2001: 无法解析的外部符号 __imp__CloseServiceHandle@4

error LNK2001: 无法解析的外部符号 __imp__OpenServiceA@12

error LNK2001: 无法解析的外部符号 __imp__QueryServiceStatus@8

error LNK2001: 无法解析的外部符号 __imp__ControlService@12

error LNK2001: 无法解析的外部符号 __imp__DeleteService@4

error LNK2001: 无法解析的外部符号 __imp__CreateServiceA@52

error LNK2001: 无法解析的外部符号 __imp__StartServiceA@12

error LNK2001: 无法解析的外部符号 __imp__RegOpenKeyExA@20

error LNK2001: 无法解析的外部符号 __imp__RegQueryValueExA@24

error LNK2001: 无法解析的外部符号 __imp__RegCloseKey@4

error LNK2001: 无法解析的外部符号 __imp__RegCreateKeyA@12

error LNK2001: 无法解析的外部符号 __imp__RegCreateKeyExA@36

error LNK2001: 无法解析的外部符号 __imp__RegSetValueExA@24

error LNK2001: 无法解析的外部符号 __imp__RegEnumKeyA@16

error LNK2001: 无法解析的外部符号 __imp__RegDeleteKeyA@8

error LNK2001: 无法解析的外部符号 __imp__RegDeleteValueA@8

error LNK2001: 无法解析的外部符号 __imp__RegQueryInfoKeyA@48

error LNK2001: 无法解析的外部符号 __imp__RegEnumKeyExA@32







原因:



本来程序的编译选项选择的是:使用标准windows库,当改为在静态库中使用MFC后就出现了上面的错误







解决方法

代码中添加依赖库

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

error LNK2001: 无法解析的外部符号 __imp__RegEnumKeyExA@32的更多相关文章

  1. error LNK2001: 无法解析的外部符号

    1.错误描述 error LNK2001: 无法解析的外部符号 "__declspec(dllimport) void __cdecl PadSystem::Private::printQS ...

  2. c++中调用python脚本提示 error LNK2001: 无法解析的外部符号 __imp_Py_Initialize等错误的解决方法

    最近项目中需要实现一个服务器宕机后短信提醒的功能,个人觉得在使用Python 写http请求这块很方便,发短信这块就使用了python,但是c++程序中调用这个脚本时,编译不通过,提示如下错误: er ...

  3. C++工程编译之“error LNK2001: 无法解析的外部符号”

    今天一整天都在折腾“error LNK2001: 无法解析的外部符号”,就在头疼不已的时候,总算是找到问题原因了:各个动态链接库的编译方式必须统一才行,要不然很容易对库函数的引用产生冲突.简单来说就是 ...

  4. error LNK2001: 无法解析的外部符号 _IID_IDirectDraw7

    工程使用了DirectDraw,编译出错 error LNK2001: 无法解析的外部符号 _IID_IDirectDraw7 解决办法是吧dxguid.lib添加到工程中,把lib所在目录添加到工程 ...

  5. error LNK2001: 无法解析的外部符号 "public: char * __thiscall

    error LNK2001: 无法解析的外部符号 "public: char * __thiscall CamPinPadCtrl::KeysConvert(unsigned long,ch ...

  6. 【转】strmbasd.lib(dllentry.obj) : error LNK2001: 无法解析的外部符号"int g_cTemplates"

    加入了DirectShow的基类链接库后,如果此时编译就会出现以下编译错误: strmbasd.lib(wxutil.obj) : error LNK2019: 无法解析的外部符号 __imp__ti ...

  7. 无法链接glew的解决办法-编译开源库出现: error LNK2001: 无法解析的外部符号

    无法链接glew的解决办法-编译开源库出现: error LNK2001: 无法解析的外部符号 参考官方配置指南:http://glew.sourceforge.net/install.html 1. ...

  8. error LNK2001: 无法解析的外部符号 _H5T_NATIVE_DOUBLE_g

    最近在编译一个C++动态链接库时遇到一个奇怪的问题,我们基于GsTL实现了GIS地统计分析中的半变异函数分析以及 克吕格插值,GsTL在计算半变异函数时依赖HDF5库,当添加了HDF5的头文件.lib ...

  9. gSoap的“error LNK2001: 无法解析的外部符号 _namespaces”解决方法

    错误 2 error LNK2001: 无法解析的外部符号 _namespaces 解决方法: 1. 在工程中定义 WITH_NONAMESPACES 宏 2.尝试 "#include &q ...

随机推荐

  1. vue-element-admin安装失败的问题

    根据官网的介绍,从GitHub下载以后,安装依赖的时候一直不成功,试了很多办法,最终解决 先记录错误的过程: 从GitHub下载 在当前文件夹的地址栏输入 “cmd” 打开窗口 输入 npm inst ...

  2. .content和.text的区别

    python中内置库 requests的两种方法get()和post()返回的的一个对象,有两种方法.content和.text ..content返回的是字节码,.text返回的是字符串.

  3. 20175223 《Java程序设计》第十一周学习总结

    目录 教材学习内容总结 代码调试中的问题和解决过程 1. Linux中编程实现计算器方法乘法报错,但 IDEA 中可以. [代码托管] 学习进度条 参考资料 目录 教材学习内容总结 因未熟练掌握第十章 ...

  4. HDU 6625 three arrays 求两个序列异或最小值的排列(一个可以推广的正解

    目录 题意: 解析 原题描述 字典树动态求Mex @(hdu 6625求两个序列异或最小值的排列) 题意: \(T(100)\)组,每组两个长度为\(n(100000)\)的排列,你可以将\(a[]\ ...

  5. NGINX-二级域名

    先给二级域名添加到 DNS 解析再配置 nginx server { #侦听80端口 listen 80; #定义使用 www.nginx.cn访问 server_name ~^(?<subdo ...

  6. js匿名函数测试

    js匿名函数测试 <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> < ...

  7. linux卸载

    centos平台 yum remove xxxrpm包,rpm -e xxxtar包直接删除该文件或者make uninstall xxx

  8. Eclipse转idea改设置

    1 自动导包:画圈的打钩,实现自动导包,去除无用包.导入的类名相同时需要自己手动导包->  alt+enter. 2:修改快捷键 左移光标,右移同理. 上移光标:下移同理 光标移至行首,行末为e ...

  9. upc组队赛6 Progressive Scramble【模拟】

    Progressive Scramble 题目描述 You are a member of a naive spy agency. For secure communication,members o ...

  10. Redis源码编译安装

    介绍 REmote DIctionary Server(Redis) 是一个由Salvatore Sanfilippo写的key-value存储系统.Redis是一个开源的使用ANSI C语言编写.遵 ...