错误:

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. Hadoop2.7.3+Hbase-1.2.6+spark2.1.2完全分布式安装部署

    https://www.cnblogs.com/lzxlfly/p/7221890.html 总的下载地址:      http://mirror.bit.edu.cn/apache/ hadoop下 ...

  2. (转)Spring Boot干货系列:(七)默认日志logback配置解析

    转:http://tengj.top/2017/04/05/springboot7/ 前言 今天来介绍下Spring Boot如何配置日志logback,我刚学习的时候,是带着下面几个问题来查资料的, ...

  3. C++之前置自增与后置自增

    关于前置自增与后置自增的区别我是参考这里:http://bbs.bccn.net/thread-454977-1-1.html 简单复述下,比如++x; 与 x++; 在C中,++x这个表达式的值为原 ...

  4. jsp中jstl、el使用

    tomcat7.0+JSTL1.1.2(不冲突) EL表达式获取变量 ${表达式} 如:${user.name} 不可以动态取值 ${user[name]}可以动态取值,变量名中含有特殊字符时只能用此 ...

  5. python 使用yaml模块

    python:yaml模块一.yaml文件介绍YAML是一种简洁的非标记语言.其以数据为中心,使用空白,缩进,分行组织数据,从而使得表示更加简洁.1. yaml文件规则基本规则:    大小写敏感   ...

  6. 编译Android系统源码和内核源码

    [日期:2016-01-11] 来源:Linux社区  作者:jiangwei [字体:大 中 小]     把我之前编译Android系统源码和内核源码的过程记录一下,因为这个过程真的是受益匪浅,看 ...

  7. Linux(一)—— Linux环境搭建

    Linux环境搭建 一.虚拟机安装 1.下载地址 https://my.vmware.com/web/vmware/info/slug/desktop_end_user_computing/vmwar ...

  8. springboot中的mybatis是如果使用pagehelper的

    springboot中使用其他组件都是基于自动配置的AutoConfiguration配置累的,pagehelper插件也是一样的,通过PageHelperAutoConfiguration的,这个类 ...

  9. 处理CSS前缀问题的神器——AutoPrefixer

    众所周知为兼容所有浏览器,有的CSS属性需要对不同的浏览器加上前缀,然而有时添加一条属性,需要添加3~4条类似的属性只是为了满足浏览器的兼容,这不仅会增加许多的工作量. What is AutoPre ...

  10. 【记录】利用Jquery 在 textarea 内实现文字动态换行

    背景: 最近在做前端时候遇到一种情况,需要用js动态输入内容到textarea, 比如实时聊天功能,用户A每次发送信息都需要另起一行. 问题: 根据以往经验,以为用$('#textArea').htm ...