problem in running mex file

2 ビュー (過去 30 日間)
MODEM
MODEM 2012 年 4 月 12 日
Hello, While running mex file i am getting problem. I tried to run file in three ways
(I)First case i given the file path to run code
>>mex mex_find_epipolar_match.c MATLAB/R2010b/extern/lib/win32/lcc/libmwlapack.lib;
LINK : fatal error LNK1181: cannot open input file 'MATLAB\R2010b\extern\lib\win32\lcc\libmwlapack.lib'
D:\PROGRA~1\MATLAB\R2010B\BIN\MEX.PL: Error: Link of 'mex_find_epipolar_match.mexw32' failed.
??? Error using ==> mex at 208 Unable to complete successfully.
(II)second case i copied the library to current folder then
>>mex mex_find_epipolar_match.c libmwlapack.lib;
Creating library D:\Users\sudhakar\AppData\Local\Temp\mex_ra3IPZ\templib.x and object D:\Users\sudhakar\AppData\Local\Temp\mex_ra3IPZ\templib.exp
mex_find_epipolar_match.obj : error LNK2019: unresolved external symbol _dgemm referenced in function _ComputeResid
mex_find_epipolar_match.mexw32 : fatal error LNK1120: 1 unresolved externals
D:\PROGRA~1\MATLAB\R2010B\BIN\MEX.PL: Error: Link of 'mex_find_epipolar_match.mexw32' failed.
??? Error using ==> mex at 208 Unable to complete successfully.
(III)with out any given library file
>>mex mex_find_epipolar_match.c
Creating library D:\Users\sudhakar\AppData\Local\Temp\mex__NhcC8\templib.x and object D:\Users\sudhakar\AppData\Local\Temp\mex__NhcC8\templib.exp
mex_find_epipolar_match.obj : error LNK2019: unresolved external symbol _dgemm referenced in function _ComputeResid
mex_find_epipolar_match.obj : error LNK2019: unresolved external symbol _dgesvd referenced in function _ComputeXLinear
mex_find_epipolar_match.obj : error LNK2019: unresolved external symbol _dgesv referenced in function _ComputeXNonLinear
mex_find_epipolar_match.mexw32 : fatal error LNK1120: 3 unresolved externals
D:\PROGRA~1\MATLAB\R2010B\BIN\MEX.PL: Error: Link of 'mex_find_epipolar_match.mexw32' failed.
??? Error using ==> mex at 208 Unable to complete successfully.
Any one can help to fix this problem to run code

採用された回答

James Tursa
James Tursa 2012 年 4 月 12 日
Versions of MATLAB through R2006b had the BLAS and LAPACK routines in one library, the libmwlapack.lib file. Versions of MATLAB R2007a and later split them into two separate libraries, libmwblas.lib and libmwlapack.lib. The routine you are missing from your link, dgemm, is a BLAS routine. You need to include the libmwblas.lib file in your mex command (in addition to keeping the libmwlapack.lib for the LAPACK routines you use).
  1 件のコメント
MODEM
MODEM 2012 年 4 月 12 日
Thank u very much Mr.James, Problem solved

サインインしてコメントする。

その他の回答 (1 件)

Titus Edelhofer
Titus Edelhofer 2012 年 4 月 12 日
Hi,
the path to the lapack looks strange. It should be something like
mex mex_find_epipolar_match.c c:\MATLAB\R2010b\extern\lib\win32\lcc\libmwlapack.lib
or better
mex('mex_find_epipolar_match.c', fullfile(matlabroot, 'R2010b', 'extern', 'lib', 'win32', 'lcc', 'libmwlapack.lib'));
Titus
  1 件のコメント
MODEM
MODEM 2012 年 4 月 12 日
Thank u for your assistance Titus.

サインインしてコメントする。

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by