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 无法解析的外部符号 的一些可能的原因

未包含系统库文件

错误一:无法打开包括文件:“inttypes.h”: No such file or directory

解决方法:删除之,并在其之前添加如下代码:

#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)”改成“不使用预编译头

9.错误:_cdecl
在obj中 定义

函数名前面加上static

10 出现fatal
error rc1107 错误的处理办法

工具 -> options -> project and solutions -> vc++ directorie
把右边include files里面的路径的最后面的‘\’去掉

例如

原来是:     $(VCInstallDir)include\

改成:        $(VCInstallDir)include

——上面只是一个举例,我自己是因为OpenCV的include后面不小心带了个‘\’。。囧

Visual Stdio C++ 编译常见问题的更多相关文章

  1. 应对 Visual Stdio 编译时出现错误:常量中有换行符

    笔者最近用 Visual Stdio 时,发现一个问题,在某一次写完语言进行编绎运行时,出现了以下错误: C2001错误:变量中有换行符 C2413错误:语法错误 缺少")"(在& ...

  2. Visual Studio 2013 编译 64 位 Python 的 C 扩展 (使用 PyObject 包装)

    对于 32 位 Python 的 C 扩展,以前用过 mingW32 编译, 但是 mingW32 不支持 64 位 Python 的 C 扩展编译,详情可见 stackoverflow,这位前辈的大 ...

  3. Visual Stdio 环境下使用 GSL (GNU Scientific Library)

    Visual Stdio 环境下使用 GSL (GNU Scientific Library) 经測试.这里的方法不适用于VS2015. * 这篇文章有点过时了.建议从以下网址下载能够在 vs 环境下 ...

  4. Visual Stdio C++ 编译器、链接器常用命令

    概览: cmd常用命令配合使用: del 删除指定文件 同erase cls 清屏 rd 删除空目录文件夹 dir 显示目录 cd 在当前盘符跳转指定目录(不同盘符跳转用盘符号)(分别表示根目录 上一 ...

  5. Visual Studio 2010编译时总是提示"调用目标发生了异常"的解决

    现象: 无论建立的是Win32 Console的解决方案,还是MFC的解决方案,重新打开Visual Studio 2010之后,编译时总是提示“调用的目标发生了异常” 解决: 1. 关闭Visual ...

  6. visual stdio 2015安装配置及原理

    安装与配置: 1.先配置好IIS,再安装visual stdio,主要原因系统会自注册.net Framework,若顺序不正确,则需手动注册,步骤: a. IIS可承载的Web核心 b. IIS6 ...

  7. 关于Visual Studio 2013 编译 multi-byte character set MFC程序出现 MSB8031 错误的解决办法

    转自:http://blog.csdn.net/xiaochunzao/article/details/16987703 Visual Studio 2013 编译旧的 multi-byte char ...

  8. Windows下使用Visual Studio 2010编译ffmpeg全过程

    在visual studio 2010中调用ffmpeg http://blog.sina.com.cn/s/blog_4178f4bf01018wqh.html Windows下使用Visual S ...

  9. DUIEngine使用Visual Studio 2010编译Debug_Dll版有关Error MSB3073错误解决方案

    在使用Visual Studio 2010编译DUIEngine的Debug_Dll版如果遇见如下错误: 错误 64 error MSB3073: 命令“copy D:\SomePath\DUIEng ...

随机推荐

  1. linux内核中的__cpu_suspend是在哪里实现的呀?

    1. 内核版本 4.19 2. 在arch/arm/kernel/sleep.S中实现如下: /* * Save CPU state for a suspend. This saves the CPU ...

  2. 动画之Evaluator

    Evaluator就是通过监听器拿到当前动画对对应的具体数值,作用在于从插值器返回的数值进行转换成对应的数值.简单来说就是转换器 Evaluator返回值的类型更加动画中值决定的,所以在使用的时候注意 ...

  3. 5.7版本mysql查询报错:com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:...this is incompatible with sql_mode=only_full_group_by

    先瞧下日志: ### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException ...

  4. 一百四十二:CMS系统之帖子详情页面布局

    定义一个404页面 <!DOCTYPE html><html lang="en"><head> <meta charset="U ...

  5. iOS笔试题01

    1. #import 跟#include.@class有什么区别?#import<> 跟 #import”"又什么区别? 1> #import和#include都能完整地包 ...

  6. iOS-UILabel的使用

     常用属性UILabel //显示的文字 @property(nonatomic,copy)   NSString           *text; //字体 @property(nonatomic, ...

  7. 海量无损高音质音乐文件分享180TB(持续更新)

    海量无损高音质音乐文件分享180TBWAV,flac,ape格式(持续更新),由于本人是音乐发烧爱好者,收集海量的无损音乐,已经分类好了,比较方便查找,但是本地没法存储,所有放在网盘中,并且我这边还会 ...

  8. COLLATION 'latin1_swedish_ci' is not valid for CHARACTER SET 'utf8'

    初始化 加上参数 --collation-server=utf8_general_ci 初始化 ./scripts/mysql_install_db --user=mysql --basedir=/u ...

  9. 用BERT做语义相似度匹配任务:计算相似度的方式

    1. 自然地使用[CLS] 2. cosine similairity 3. 长短文本的区别 4. sentence/word embedding 5. siamese network 方式 1. 自 ...

  10. UiPath工具取得网页上面的数据,写入到csv,Outlook邮件发送

    问题描述: 想取得网页上面的股票价格,之后写入到csv文本里面之后添加附件发送邮件. 解决方法: 利用UIPath工具来取得数据,之后写入再发送. 具体步骤: 1.打开网页,之后找到所显示的股票行情的 ...