Visual Stdio C++ 编译常见问题
1. new 数组出现崩溃
new 数组时数组下标出现负值,但未做出错处理;
new数组,数组字节数大于4MB的时候有可能出现crash!
解决办法: 加入 try catch 后,这样的错误几乎没有了,但是这样不是解决办法,只是给程序埋了个地雷。
try{
cur_img.data[0] = new uint8_t[1280*720];
cur_img.data[1] = new uint8_t[1280*360];
cur_img.data[2] = new uint8_t[1280*360];
}catch(...){}
2. LNK1123: 转换到 COFF 期间失败: 文件无效或损坏
方案一:(这个方法比较好,在用qt运行时出现问题也能解决)
复制 C:\Windows\winsxs\x86_netfx-cvtres_for_vc_and_vb_b03f5f7f11d50a3a_6.1.7601.17514_none_ba1c770af0b2031b 目录下的 cvtres.exe 到C:\Program Files\Microsoft Visual Studio 10.0\VC\bin 目录下,直接覆盖替换。
3. Link 2001 无法解析的外部符号 的一些可能的原因
未包含系统库文件
解决方法:删除之,并在其之前添加如下代码:
#if defined(WIN32) && !defined(__MINGW32__) && !defined(__CYGWIN__)
# define CONFIG_WIN32
#endif
#if defined(WIN32) && !defined(__MINGW32__) && !defined(__CYGWIN__) && !defined(EMULATE_INTTYPES)
# define EMULATE_INTTYPES
#endif
#ifndef EMULATE_INTTYPES
# include <inttypes.h>
#else
typedef signed char int8_t;
typedef signed short int16_t;
typedef signed int int32_t;
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
# ifdef CONFIG_WIN32
typedef signed __int64 int64_t;
typedef unsigned __int64 uint64_t;
# else /* other OS */
typedef signed long long int64_t;
typedef unsigned long long uint64_t;
# endif /* other OS */
#endif /* EMULATE_INTTYPES */
错误二: error C3861: “UINT64_C”: 找不到标识符
解决方法:在common.h中添加如下代码:
#ifndef INT64_C
#define INT64_C(c) (c ## LL)
#define UINT64_C(c) (c ## ULL)
#endif
5 _‘avcodec_decode_audio3': 被声明为已否决
下面是几种解决方法
1)Project Properties > Configuration Properties > C/C++ > General > SDL checks关掉
2) #pragma warning(disable: 4996)
3) /wd 4996
4) .其实最好使用ffmpeg最新版本的函数:avcodec_decode_audio4
6.XTToolKit 出现如下错误
r C1189: #error : This build configuration is not supported by the evaluation library, choose either 'Debug' or 'Unicode Debug'.
项目---设置----在动态库(DLL)中使用MFC
7. VS Debug 模式下断点有问题,运行时无法加断点
工具-》选项-〉调试-〉编辑并继续-〉启用本机编辑并继续勾选上即可
8. fatal
error C1010: 在查找预编译头时遇到意外的文件结尾。是否忘记了向源中添加“#include "stdafx.h
1) 在解决方案资源管理器中,右击相应的.cpp文件,点击“属性”
2) 在左侧配置属性中,点开“C/C++”,单击“预编译头”3) 更改右侧第一行的“创建/使用预编译头”,把选项从“使用预编译头(/Yu)”改成“不使用预编译头
函数名前面加上static
10 出现fatal
error rc1107 错误的处理办法
例如
原来是: $(VCInstallDir)include\
改成: $(VCInstallDir)include
——上面只是一个举例,我自己是因为OpenCV的include后面不小心带了个‘\’。。囧
Visual Stdio C++ 编译常见问题的更多相关文章
- 应对 Visual Stdio 编译时出现错误:常量中有换行符
笔者最近用 Visual Stdio 时,发现一个问题,在某一次写完语言进行编绎运行时,出现了以下错误: C2001错误:变量中有换行符 C2413错误:语法错误 缺少")"(在& ...
- Visual Studio 2013 编译 64 位 Python 的 C 扩展 (使用 PyObject 包装)
对于 32 位 Python 的 C 扩展,以前用过 mingW32 编译, 但是 mingW32 不支持 64 位 Python 的 C 扩展编译,详情可见 stackoverflow,这位前辈的大 ...
- Visual Stdio 环境下使用 GSL (GNU Scientific Library)
Visual Stdio 环境下使用 GSL (GNU Scientific Library) 经測试.这里的方法不适用于VS2015. * 这篇文章有点过时了.建议从以下网址下载能够在 vs 环境下 ...
- Visual Stdio C++ 编译器、链接器常用命令
概览: cmd常用命令配合使用: del 删除指定文件 同erase cls 清屏 rd 删除空目录文件夹 dir 显示目录 cd 在当前盘符跳转指定目录(不同盘符跳转用盘符号)(分别表示根目录 上一 ...
- Visual Studio 2010编译时总是提示"调用目标发生了异常"的解决
现象: 无论建立的是Win32 Console的解决方案,还是MFC的解决方案,重新打开Visual Studio 2010之后,编译时总是提示“调用的目标发生了异常” 解决: 1. 关闭Visual ...
- visual stdio 2015安装配置及原理
安装与配置: 1.先配置好IIS,再安装visual stdio,主要原因系统会自注册.net Framework,若顺序不正确,则需手动注册,步骤: a. IIS可承载的Web核心 b. IIS6 ...
- 关于Visual Studio 2013 编译 multi-byte character set MFC程序出现 MSB8031 错误的解决办法
转自:http://blog.csdn.net/xiaochunzao/article/details/16987703 Visual Studio 2013 编译旧的 multi-byte char ...
- Windows下使用Visual Studio 2010编译ffmpeg全过程
在visual studio 2010中调用ffmpeg http://blog.sina.com.cn/s/blog_4178f4bf01018wqh.html Windows下使用Visual S ...
- DUIEngine使用Visual Studio 2010编译Debug_Dll版有关Error MSB3073错误解决方案
在使用Visual Studio 2010编译DUIEngine的Debug_Dll版如果遇见如下错误: 错误 64 error MSB3073: 命令“copy D:\SomePath\DUIEng ...
随机推荐
- Angular 中的 dom 操作(ViewChild)以及父子组件中通过 ViewChild 调用子组件的方法
<app-header #header></app-header> <div #myBox> 我是一个dom节点 </div> <button ( ...
- Android仿微信底部选项卡
第一步 添加依赖 dependencies { compile 'com.yinglan.alphatabs:library:1.0.5' } 第二步 布局使用 <?xml version=&q ...
- 创建Bitmap之Bitmap静态方法使用示例
package com.loaderman.customviewdemo; import android.app.Activity; import android.content.Intent; im ...
- [Java复习] 分布式事务 Part 2
分布式事务了解吗?如果解决分布式事务问题的? 面试官心里: 只要聊到你做了分布式系统,必问分布式事务,起码得知道有哪些方案,一般怎么来做,每个方案的优缺点是什么. 为什么要有分布式事务? 分布式事务实 ...
- TweenJS----前端常用的js动画库,缓动画和复制动画的制作,效果非常好。
TweenJS类库主要用来调整和动画HTML5和Javascript属性,提供了简单并且强大的tweening接口. http://www.createjs.cc/tweenjs/ http://ww ...
- osg qt fbx
void TeslaManage::loadModelFile(QString &filename) { file_node = osgDB::readNodeFile(std::string ...
- 阶段5 3.微服务项目【学成在线】_day18 用户授权_09-动态查询用户的权限-认证服务查询用户权限
认证服务查询用户权限 如果权限为空就New一个对象出来. 因为如果为空的话 下面 forEach就会报空指针的异常 启动服务测试 重新登陆 看到userExt已经获取到了用户的权限 权限的字符串 复制 ...
- 在过滤器中获取在web.xml配置的初始化参数
在过滤器中获取在web.xml配置的初始化参数 例如 <filter> <filter-name>cross-origin</filter-name> < ...
- 丢失libiconv-2.dll解决办法以及无法定位输入点libiconv-2.dll到动态链接库
摘自https://blog.csdn.net/mengxiangjia_linxi/article/details/78147348 丢失libiconv-2.dll解决办法以及无法定位输入点lib ...
- 修改root密码
Linux 密码的修改,使用passwd 命令修改 命令如下图:sudo passwd root 即可修改成功