日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

VS 编程常见错误及解决方法

發布時間:2024/4/17 编程问答 57 豆豆
生活随笔 收集整理的這篇文章主要介紹了 VS 编程常见错误及解决方法 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

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; }

?

轉載于:https://www.cnblogs.com/haoyul/p/5384293.html

總結

以上是生活随笔為你收集整理的VS 编程常见错误及解决方法的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。