1. VS2013 无法打开包括文件:“cv.h"等一些头文件

解决方法:

cv.h是build\include文件夹下的头文件,所在文件夹位置是D:\Program Files (x86)\opencv\build\include\opencv,必须将这个路径添加到OpencvDebugConfiguration.props(见上一篇)中:

 
 
2.

错误一:必须属性”VSIstallDir”缺失或为空 

解决方式:选择菜单栏的项目->属性->配置属性->常规->平台集成工具,选择V90编辑为V100,点击确定。之后运行就不会再出现必须属性”VSInstallDir”缺失或为空的错误了。 

错误二:找不到projectname.exe 
 
解决方式: 
1、选择菜单栏的项目->属性->配置属性->VC目录->包含目录->编辑 
 
添加:matlab安装目录\extern\include,然后点击确定 

2、选择菜单栏的项目->属性->配置属性->VC目录->库目录->编辑 
添加:matlab安装目录\extern\lib\win64\microsoft 

3、选择菜单栏的项目->属性->配置属性->C++->常规->附加包目录->编辑,添加:libmx.lib;libeng.lib;libmat.lib; 点击确定 

4、选择菜单栏的项目->属性->配置属性->链接器->输入->附加依赖项->编辑,添加:libmx.lib;libeng.lib;libmat.lib; 点击确定

5、选择菜单栏的解决方案平台,选择win64(倘若没有这个选项,则选择配置管理器->选择平台->新建->选择win64->确定即可) 

最后得到运行结果: 

附上测试代码:

#include "stdafx.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "engine.h"
#include "matrix.h"
#pragma comment(lib,"libeng.lib")
#pragma comment(lib,"libmx.lib")
int main()
{
Engine *ep;
int i , j ;
//show how to open MATLAB engine
//for remote ones:
//engOpen( ADDRESS OF REMOTE SYSTEM ) ;
if (!(ep = engOpen("\0"))){
fprintf(stderr, "\nCan't start MATLAB engine\n");
return EXIT_FAILURE;
}
//show how to create matrix
mxArray *Y = mxCreateDoubleMatrix(1 , 3 , mxREAL) ; //show how to put data in matrix
double tmp[3] = {1.0 , 2.0 , 3.0} ;
memcpy(mxGetPr(Y) , tmp , sizeof(tmp)) ;
//show how to put variables in the Engine
engPutVariable(ep , "Y" , Y) ;
//show how to execute commands in MATLAB
engEvalString(ep, "X = ones(5,1) * Y"); //show how to get variables from the Engine
mxArray *X = engGetVariable(ep , "X") ; //show how to manipulate dimensions
int dims[10] ;
int ndims ;
ndims = mxGetNumberOfDimensions(X) ;
printf("total number of dimensions is %d\n" , ndims) ;
memcpy(dims , mxGetDimensions(X) , ndims * sizeof(int)) ;
for ( i = 0 ; i < ndims ; i ++ ){
printf("dimension %d : %d\n" , i , dims[i]) ;
}
printf("\n") ;
//show how the data is stored in the memory
double *p = (double*)mxGetData(X) ;
for ( i = 0 ; i < dims[0] ; i ++ ){
for ( j = 0 ; j < dims[1] ; j ++ ){
printf("%8.2f" , p[j * dims[0] + i]) ;
}
printf("\n") ;
}
//---important, to release resources
mxDestroyArray(X) ;
mxDestroyArray(Y) ;
//show how to hide and unhide MATLAB command window
printf("type RETURN to hide the MATLAB command window...\n") ;
getchar() ;
engSetVisible(ep , false) ;
printf("type RETURN to unhide the MATLAB command window...\n") ;
getchar() ;
engSetVisible(ep , true) ;
printf("type RETURN to END this program...\n") ;
getchar() ;
//remembering to close it is important .
//but if you are debugging your programs ,
//annotate the following line will save you a lot of time ,
//for you needn't to restart the Engine .
engClose(ep) ; //when your work is accomplished , type "exit" in MATLAB command window
return EXIT_SUCCESS;
}

VS 编程常见错误及解决方法的更多相关文章

  1. Servlet常见错误及解决方法

    常见错误及解决方法 1. 404产生的原因为Web服务器(容器)根据请求地址找不到对应资源,以下情况都会出现404的错误提示: 输入的地址有误(应用名大小写不正确,名称拼写不正确) 在web.xml文 ...

  2. IIS7常见错误及解决方法

    IIS7常见错误及解决方法   问题一:HTTP 错误 500.19 - Internal Server Error 无法访问请求的页面,因为该页的相关配置数据无效.  详细错误信息模块 IIS We ...

  3. 微信jssdk常见错误及解决方法

    调用config 接口的时候传入参数 debug: true 可以开启debug模式,页面会alert出错误信息.以下为常见错误及解决方法: invalid url domain当前页面所在域名与使用 ...

  4. centos linux 系统日常管理4 scp,rsync,md5sum,sha1sum,strace ,find Rsync 常见错误及解决方法 第十七节课

    centos linux 系统日常管理4  scp,rsync,md5sum,sha1sum,strace ,find Rsync 常见错误及解决方法  第十七节课 rsync可以增量同步,scp不行 ...

  5. WCF项目中出现常见错误的解决方法:基础连接已经关闭: 连接被意外关闭

    在我们开发WCF项目的时候,常常会碰到一些莫名其妙的错误,有时候如果根据它的错误提示信息,一般很难定位到具体的问题所在,而由于WCF服务的特殊性,调试起来也不是那么方便,因此往往会花费不少时间来进行跟 ...

  6. cmd常见错误及解决方法

    [英文] Bad command or file name [译文] 错误的命令或文件名 错误原因和解决: 这大概是大家最常见到的错误提示了,它的意思是输入的命令无效.当输入的命令既不是DOS内部命令 ...

  7. jmeter常见错误及解决方法

    jmeter常见错误:   错误一: Response code: Non HTTP response code: java.net.SocketTimeoutException Response m ...

  8. Android 源码编译及常见错误及解决方法

    最近要往arm开发板上移植android系统,大大小小的问题遇到了太多太多,都是泪啊.本人初接触嵌入式开发,对问题的根源不是太了解,不过好在每解决一个问题,便记录一下.话不多说,正式罗列问题: hos ...

  9. Rsync 常见错误及解决方法

    由于阿里云SLB不提供ECS间的数据同步服务,如果部署在SLB后端ECS上的应用服务是无状态的,那么可以通过独立的ECS或RDS服务来存储数据:如果部署在SLB后端ECS上的应用服务是有状态的,那么需 ...

随机推荐

  1. 凯撒密码 CH Round #57 - Story of the OI Class

    题目:http://ch.ezoj.tk/contest/CH%20Round%20%2357%20-%20Story%20of%20the%20OI%20Class/凯撒密码 题解:刚开始想map, ...

  2. poj3071 Football

    学习位运算在比赛的技巧 http://poj.org/problem?id=3071 Football Time Limit: 1000MS   Memory Limit: 65536K Total ...

  3. tomcat配置多实例

    CATALINA_HOME环境变量不必配置,因为在startup.sh脚本里会指定CATALINA_HOME的位置.     配置tomcat多实例 首先是理解下原理:CATALINA_HOME指向安 ...

  4. Supervisord管理

    原文地址:http://blog.csdn.net/fyh2003/article/details/6837970 学习笔记 Supervisord可以通过sudo easy_install supe ...

  5. 修改maven中的jdk版本

    1.修改项目的pom.xml文件 <build> <plugins> <plugin> <groupId>org.apache.maven.plugin ...

  6. java ee eclipse 配置 ssh框架

    mvnDebug tomcat:run 这条命令主要用来远程测试,它会监听远程测试用的8000端口,在eclipse里打开远程测试后,它就会跑起来了,设断点,调试,一切都是这么简单. 0.如果是mav ...

  7. openstack 启用spice

    Openstack启用spice协议 #控制节点 #安装 ? 1 apt-get install nova-spiceproxy spice-html5 spice-vdagent #配置 nano ...

  8. poj 2253 Frogger【最小生成树变形】【kruskal】

    Frogger Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 30427   Accepted: 9806 Descript ...

  9. thymeleaf 和其它标签组合 获取数据

    thymeleaf 有很多的内置标签, 但是我们在开发中会引入其它很多标签, 这个时候, 后台数据过来了,前端 页面要怎么显示呢? 网上资料真的很少. 不过还是找到了答案:  th:attr 这个标签 ...

  10. Eclipse中修改SVN用户名和密码方法

    于在svn 的界面中并没有为我们提供直接更换用户名密码的地方,所以一旦我们需要更换用户名的就需要自己想一些办法. 解决方案: 在Eclipse 使用SVN 的过程中大多数人往往习惯把访问SVN 的用户 ...