mex, error C3861: "mxGetDoubles": Cannot find the identifier, "mxGetUint8s": Cannot find the identifier ?

23 ビュー (過去 30 日間)
When I write the .cpp file and want to generate the .mexw64 library file, I use the mex function to compile, and an error C3861: "mxGetDoubles": identifier not found, "mxGetUint8s": identifier not found, but I can use the "mxGetPr" function to compile .cpp files for normal mex. I am using MATLAB2020b version. According to the help document, the official recommendation is to use mxGetDoubles or mxGetUint8s function instead of mxGetPr function. When I use the mxGetUint8s function to get the output *plhs[] data pointer, the compiler reported the above error, and I found the definition of mxGetUint8s in "matrix.h", and it has been included correctly. Why can't I find the identifier?
#include "mex.h"
#include "matrix.h"
#include "opencv2/opencv.hpp"
...Omit code
mxUint8 *temp,*temp2
temp = (mxUint8*)mxGetUint8s(plhs[0]); // error C3861: "mxGetUint8s": Cannot find the identifier. or "mxGetDoubles" ,use "mxGetPr" instead is OK!
temp2 = (mxUint8*)mxGetUint8s(plhs[1]);
...Omit code
My computer configuration environment:
os: win10
ide: visual studio 2015 professional
matlab: matlab2020b, or matlab2020a
However, compiling and running the code in vs2015 is ok.

採用された回答

James Tursa
James Tursa 2020 年 9 月 29 日
編集済み: James Tursa 2020 年 9 月 29 日
Those functions are for the R2018a memory model API. For that, you need to add the -R2018a option flag:
mex myfile.cpp -R2018a

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeWrite C Functions Callable from MATLAB (MEX Files) についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by