1.问题描述

vs2015 去开发一个写入pg数据库的程序,使用libpqxx.dll,libpq.dll,这个库文件之前是用vs2008的程序中复制过来的,基于的运行时库应该是vs2008,现在开发的环境是vs2015。所以导致运行时库不匹配。编译程序成功,运行程序出现Runtime Error R6034 Application has attempt to load the C runtime library incorrectly问题,然后确定后又出现应用程序无法正常启动(0xc0000142)。请单击“确定”关闭应用程序。

2.原因分析

造成这种问题的原因是libpqxx.dll,libpq.dll之前是在vs2008上编译,依赖的是vs2008的运行时库。现在vs2015环境上编译,需要指定依赖运行时库。所以要用manifest文件去指定。或者重新编译libpqxx.dll文件。

2.解决方法

2.1方案1:使用manifest文件指定加载依赖的运行时文件

步骤:

(1)创建一个Microsoft.VC90.CRT.manifest文件,放入程序所在目录,文件内容如下:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<noInheritable></noInheritable>
<assemblyIdentity type="win32" name="Microsoft.VC90.CRT" version="9.0.21022.8" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
<file name="msvcr90.dll" hashalg="SHA1" hash="98e8006e0a4542e69f1a3555b927758bd76ca07d"><asmv2:hash xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:Transforms><dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity"></dsig:Transform></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></dsig:DigestMethod><dsig:DigestValue>+CXED+6HzJlSphyMNOn27ujadC0=</dsig:DigestValue></asmv2:hash></file> <file name="msvcp90.dll" hashalg="SHA1" hash="3aec3be680024a46813dee891a753bd58b3f3b12"><asmv2:hash xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:Transforms><dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity"></dsig:Transform></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></dsig:DigestMethod><dsig:DigestValue>MyKED+9DyS+1XcMeaC0Zlw2vFZ0=</dsig:DigestValue></asmv2:hash></file> <file name="msvcm90.dll" hashalg="SHA1" hash="0195dd0896d74b62531e4f3c771904a3d996450e"><asmv2:hash xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:Transforms><dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity"></dsig:Transform></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></dsig:DigestMethod><dsig:DigestValue>EeyDE7og6WoPd2oBhYbMEnpFHhY=</dsig:DigestValue></asmv2:hash></file>
</assembly>

(2)在配置属性--链接器--清单文件--生成清单选项设置为是。否则还是会出现(1)中的问题。

(3)项目配置--清单工具---输入和输出---附加清单文件中输入文件的路径:$(SolutionDir)\bin\Microsoft.VC90.CRT.manifest,并且将嵌入清单选项设置为是。

通过这些设置之后就可以正常编译和运行。

2.2 方案2:重新用下载libpqxx源码文件,用vs2015的developer commond prompt for  vs2015 (在开始中找到vs2015,下面有这个工具)按照下面的流程去编译。

提前安装pg数据库,pg数据库的位数要与库文件的位数一致,否则会出现很多未知的错误。

https://blog.csdn.net/don211/article/details/51754869

自己开发了一个股票智能分析软件,功能很强大,需要的点击下面的链接获取:

https://www.cnblogs.com/bclshuai/p/11380657.html

百度云盘下载地址:

链接:https://pan.baidu.com/s/1swkQzCIKI3g3ObcebgpIDg

提取码:mc8l

微信公众号获取最新的软件和视频介绍

QStockView

Runtime Error R6034 Application has attempt to load the C runtime library incorrectly的更多相关文章

  1. C Run-Time Error R6034问题的解决

    1.问题描述 这两天一直在用vs2008编写一个小项目,需要在c++代码中通过命令行的方式调用cl.exe和link.exe,也就是给编译器cl和链接器link传递参数,然后编译链接生成可执行文件ex ...

  2. ArcGIS10.4 Runtime Error R6034

    现在甲方采购的ArcGIS Desktop正版,一般都是较高的版本(10.4或10.4.1),但10.4经常报出C++ Runtime R6034错误. 问题 "Microsoft Visu ...

  3. 【转载】R6034错误,C Runtime Error

    能查到的解决方法都在里面有提及: 我是使用 stdafx.h加入这句 code #pragma comment(linker, "\"/manifestdependency:typ ...

  4. Runtime Error---Description: An application error occurred on the server....

    [原]Runtime Error---Description: An application error occurred on the server.... 2010-1-7阅读2010 评论3 D ...

  5. 力扣 报错 runtime error: load of null pointer of type 'const int'

    runtime error: load of null pointer of type 'const int' 要求返回的是int* 解决方案 1.指针使用malloc分配空间 用 int * p = ...

  6. 【Azure App Service】C#下制作的网站,所有网页本地测试运行无误,发布至Azure之后,包含CHART(图表)的网页打开报错,错误消息为 Runtime Error: Server Error in '/' Application

    问题描述 C#下制作的网站,所有网页本地测试运行无误,发布至Azure之后,包含CHART(图表)的网页打开报错,错误消息为 Runtime Error: Server Error in '/' Ap ...

  7. openresty 报错:lua entry thread aborted: runtime error

    [1]问题现象 (1)本地openresty系统 (2)报错信息 2019/09/10 08:13:55 [error] 2385#2385: *4 lua entry thread aborted: ...

  8. Microsoft Visual C++ Runtime Library Runtime Error的解决的方法

    打开浏览器时,出现Microsoft Visual C++ Runtime Library Runtime Error错误,初步预计是软件冲突,可能有多种出错的方式,我的是浏览器自己主动关闭. 一. ...

  9. tomcat : Error configuring application listener of class org.springframework.web.context.ContextLoaderListener java.lang.ClassNotFoundException:

    错误 严重: Error configuring application listener of class org.springframework.web.context.ContextLoader ...

随机推荐

  1. Tika提取文件元数据

    Tika可以从文件中提取元数据. 什么是元数据: 元数据是文件所提供的的附件信息即文件的属性. word文档的元数据: Tika提取元数据: 我们可以使用文件parse()方法提取元数据,传递一个空的 ...

  2. 打印从1到最大的n位数(考虑大数问题)

    void Print1ToMaxOfNDigits(int n) { if(n <= 0) { return; } int * number = new int[n]; for(int i = ...

  3. 【Day2】3.面向对象编程

    课程目标 1. 面向对象编程 2. 类和实例 3. 访问限制 4. 实例属性和类属性 面向对象编程 • 面向对象编程是一种程序设计思想 • 面向对象把类和对象作为程序的基本单元 • 对象包含属性和方法 ...

  4. main特别之处

    //package new_Object; public class Main{ public static void main(String[] args) { System.out.println ...

  5. Hadoop_10_HDFS 的 DataNode工作机制

    1.DataNode的工作机制: 1.DataNode工作职责:存储管理用户的文件块数据  定期向namenode汇报自身所持有的block信息(通过心跳信息上报) (这点很重要,因为,当集群中发生某 ...

  6. linux syslog支持 ubuntu

    linux  syslog支持 linux  syslog支持 linux  syslog支持 ??????? https://wenku.baidu.com/view/8cc6b50a0202074 ...

  7. uboot驱动模型(DM)分析(二) (转)

    上篇分析了两个关键宏U_BOOT_DRIVER及U_BOOT_DEVICES的作用,有了上篇的基础,本文将分析: 1.上篇中的uboot_list段中的信息如何被用起来? 2.uclass,uclas ...

  8. [Ahoi2009]self 同类分布

    1799: [Ahoi2009]self 同类分布 Time Limit: 50 Sec  Memory Limit: 64 MBSubmit: 2357  Solved: 1079[Submit][ ...

  9. BZOJ4777 [Usaco2017 Open]Switch Grass[最小生成树+权值线段树套平衡树]

    标题解法是吓人的. 图上修改询问,不好用数据结构操作.尝试转化为树来维护.发现(不要问怎么发现的)最小生成树在这里比较行得通,因为最近异色点对一定是相邻的(很好想),所以只要看最短的一条两端连着异色点 ...

  10. Hadoop下MapReduce实现Pi值的计算

    Hadoop自带的例子中,有一个计算Pi值的例子. 这个程序的原理是这样的.假如有一个边长为1的正方形.以正方形的一个端点为圆心,以1为半径,画一个圆弧,于是在正方形内就有了一个直角扇形.在正方形里随 ...