C Run-Time Error R6034问题的解决
1、问题描述
这两天一直在用vs2008编写一个小项目,需要在c++代码中通过命令行的方式调用cl.exe和link.exe,也就是给编译器cl和链接器link传递参数,然后编译链接生成可执行文件exe.最终生成的result.exe运行时老出现Runtime Error R6034 An application has made an attempt to load the C runtime library incorrectly.的错误,围绕这个问题,我查了两天的资料,最后终于解决了。。
在此简单的记录一下解决方法,方便以后用到。
2、问题解决
在利用命令行的方式编译链接生成可执行文件之前,可以将需要传递给cl.exe的源程序(.cpp,.h)文件拎出来,利用这些源文件手动的创建一个vs2008工程,然后编译链接这个vs2008工程生成可执行文件。做这一步是为了保证生成的可执行文件是你本人需要的结果,如果这个手动工程都不能生成你需要的exe,那通过命令行的方式生成的exe肯定就不是你想要得到的结果。
生成好vs2008工程并且执行正确后,在这个工程的项目--->属性-->c/c++--->命令行,你会看到一大堆的命令,其实这就是传递给cl.exe的命令,同样的道理,在项目--->属性-->链接器--->命令行中可以看到传递给link.exe的命令。
按照上面所说的方法,我在自己的项目中编写好自动生成exe 的代码生成一个exe。然后点击这个exe,就出现Runtime Error R6034 。
下面贴上解决该问题的原文:
An application has made an attempt to load the C runtime library without using a manifest. This is an unsupported way to load Visual C++ DLLs. You need to modify your application to build with a manifest. For more information, see the "Visual C++ Libraries as Shared Side-by-Side Assemblies" topic in the product documentation.
Applications must use a manifest to load the C runtime library. For more information, see Visual C++ Libraries as Shared Side-by-Side Assemblies and Manifest Generation in Visual Studio.
In release builds, the diagnostic message reads: "An application has made an attempt to load the C runtime library incorrectly. Please contact the application's support team for more information."
To correct this error
Rebuild your application to include a manifest. Building an application with Visual Studio automatically puts the manifest into the resulting .exe or .dll file. If you are building at the command line, use the mt.exe tool to add the manifest as a resource. Use resource ID 1 if you build an .exe, and resource ID 2 if you build a .dll. For more information, see How to: Embed a Manifest Inside a C/C++ Application.
重点是这一句:If you are building at the command line, use the mt.exe tool to add the manifest as a resource. Use resource ID 1 if you build an .exe, and resource ID 2 if you build a .dll. For more information, see How to: Embed a Manifest Inside a C/C++ Application.
按照这个说法,命令行不仅需要调用cl.exe和link.exe,还需要调用一个叫mt.exe的,mt.exe的参数其实在上文创建的vs2008工程下项目--->属性--->清单工具---->命令行有相关的命令参数。在命令中添加这一个命令之后重新执行,问题就可解决了。
C Run-Time Error R6034问题的解决的更多相关文章
- LR 报错误: C interpreter run time error: Error -- Unresolved symbol : vuser_end解决方法
Action.c(33): Error: C interpreter run time error: Action.c (33): Error -- Unresolved symbol : vuse ...
- ArcGIS10.4 Runtime Error R6034
现在甲方采购的ArcGIS Desktop正版,一般都是较高的版本(10.4或10.4.1),但10.4经常报出C++ Runtime R6034错误. 问题 "Microsoft Visu ...
- Runtime Error R6034 Application has attempt to load the C runtime library incorrectly
1.问题描述 vs2015 去开发一个写入pg数据库的程序,使用libpqxx.dll,libpq.dll,这个库文件之前是用vs2008的程序中复制过来的,基于的运行时库应该是vs2008,现在开发 ...
- 运行bee run之后出现的错误以及解决方法Failed to build the application:
运行bee run之后出现的错误以及解决方法 创建一个beego项目 bee new myapp 在该项目执行下面的代码 bee run 出现的问题 2020/04/22 21:12:07 INF ...
- vss error reading from file 解决方法
vss error reading from file 解决方法 1 若服务器中存在 vss/data/backup目录,请将该目录删掉2 运行cmd cd.. cd C:\Program Files ...
- Error reading from file 解决办法
最近安装程序遇见这个问题: Error reading from file. 解决办法: 给这个程序添加权限: 添加SYSTEM的读写改..如果比较懒,直接全部允许. 然后Retry.
- 安装CAD出现Error 1904.Module的解决方法
在安装AutoCAD2008时,安装过程中出现了一个小错误,虽然说不影响使用,也不影响功能,但还是需要把这个问题解决,今天就和大家分享解决这个问题的方法. 错误描述 会在安装过程中出现错误提示:Err ...
- Last Defence (run time error)
Last Defence时间限制:1000 ms | 内存限制:65535 KB描述Given two integers A and B. Sequence S is defined as follo ...
- Android studio Error: Modules no specified解决和真机调试
如何配置SDK百度一大堆: 前言:Android Studio很完善,如果SDK配置好,理论上就是 创建项目->创建个APP(名字自己随便起)->打开手机开发者模式运行即可:如果出了问题, ...
随机推荐
- 利用PN532读取二代证UID
准备工作 芯片选择 NFC芯片,需要支持ISO14443 Type B协议,比如PN532 阅读ISO 14443 重点阅读如下内容: 7.3.4.1 状态转换图 7.3.5 ~ 7.3.7 REQB ...
- 《MATLAB从入门到放弃》打通 “矩阵” 障碍
目录: » 矩阵的生成与大小 > 简单矩阵的生成 > 随机矩阵的生成 > 矩阵的大小 » 矩阵的索引与访问 » 矩阵的拼接与裁剪 > 矩阵的拼接 &g ...
- 【京东账户】——Mysql/PHP/Ajax爬坑之用户登录
一.引言 实现京东的账户项目,功能模块之一,用户登录.要用到的是Apach环境,Mysql.PHP以及Ajax. 二.依据功能创建库.表.记录 创建库:jd 创建表:登录表 添加三条记录 CREATE ...
- oracle数据库备份、还原 (如何将Oracle 11g备份的dat文件导入到10g数据库里面)
如何将Oracle 11g备份的dat文件导入到10g数据库里面 解决方法: 导出的时候后面加上目标数据库的版本号 导出: 在SQL plus下执行:create or replace ...
- 一个基于Asp.net MVC的博客类网站开源了!
背景说明: 大学时毕业设计作品,一直闲置在硬盘了,倒想着不如开源出来,也许会对一些人有帮助呢,而且个人觉得这个网站做得还是不错了,毕竟是花了不少心思,希望对你有所帮助. github地址:https: ...
- 一个综合实例讲解vue的基础知识点。
本文通过一个简单的实例来讲解一下vue的基本知识点.通过这个综合实例的讲解,vue的基础知识就会掌握的差不多了. 首先看一下项目的效果:
- android-蓝牙通信
一:简介 由于项目曾经想用蓝牙通信,但由于蓝牙传输速度比较慢,最终还是没有使用蓝牙,不过还是在空闲之余研究了蓝牙通信,鉴于目前网上蓝牙这块教程并不多,尤其是从蓝牙扫描,蓝牙配对,蓝牙通信等完整的教程更 ...
- GCD hdu1695容斥原理
GCD Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submiss ...
- NOIP2017SummerTraining0710
个人感受:这套题,题目泄露,没什么好打的,第一题刚开始题目理解错误,后来还行,第二道题,打了一个50还是60分的dp,第三道暴力过了小数据,拿了200分,排名15+. 问题 A: 七天使的通讯 时间限 ...
- ZOJ2185 简单分块 找规律
初步找大概位置,然后找精确位置,算是简单化的分块吧! #include<cstdio> #include<cstdlib> #include<iostream> u ...