错误:

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. ZROI week6

    ZROI week6 T1 用一个类似背包的东西记录答案. T2 好像直接用|操作即可. T3 瞎搞就完事了 T4 启发式合并,然而变量写错了,就没了... 总结 100 + 100 + 100 + ...

  2. Dart 和 Flutter 使用json_annotation和json_serializable来处理json数据教程

    在学习fultter的时候突然想到如何去处理从服务器获取的json或者将app中的对象数据转换成json上传给服务器 于是研究一下dart对json数据的处理 首先需要依赖下面的第三方库(这里要强调下 ...

  3. (转)MyEclipse中使用git

    转:https://www.jianshu.com/p/92ee5c99d3a8 Myeclipse老版本可能需要安装一个插件,高版本中已经安装好了. 连接github 当然我们之前已经有仓库了,我们 ...

  4. NIO模型学习笔记

    NIO模型学习笔记 简介 Non-blocking I/O 或New I/O 自JDK1.4开始使用 应用场景:高并发网络服务器支持 概念理解 模型:对事物共性的抽象 编程模型:对编程共性的抽象 BI ...

  5. IOS 随笔记录

    一.IOS 关闭键盘: 1.让所有控件的键盘隐藏 // 这个方法可以让整个view取消第一响应者,从而让所有控件的键盘隐藏 [self.view endEditing:YES]; 2.让某个textF ...

  6. Dubbo入门到精通学习笔记(十九):MySQL源码编译安装、MySQL主从复制的配置

    文章目录 MySQL 源码编译安装(CentOS-6.6+MySQL-5.6) 一.服务器配置: 二.源码安装 MySQL5.6.26: MySQL主从复制的配置 环境 依赖课程 MySQL 主从复制 ...

  7. Tomcat 配置安装

    1 下载和安装Tomcat服务器 Tomcat官方站点:http://jakarta.apache.org 下载Tomcat安装程序包:http://tomcat.apache.org/ 启动和测试T ...

  8. js 中常用的设计模式

    常用的设计模式: 工厂方法模式.单例模式.适配器模式.组合模式.迭代子模式 (23种设计模式) 总体来说设计模式分为三大类: ①创建型模式 共五种:工厂方法模式.抽象工厂模式.单例模式.建造者模式.原 ...

  9. Android组件内核之组件间通信方案(四)上篇

    阿里P7Android高级架构进阶视频免费学习请点击:https://space.bilibili.com/474380680本篇文章将先从以下三个内容来介绍通信方案: [Activity与Fragm ...

  10. PAT程序设计

    VS2013中自行对齐的快捷键操作: CTRL+K+F 1.定义二维数组 ]=]; 2.绝对值函数 int abs(int i) 返回整型参数i的绝对值 double cabs(struct comp ...