Error using mex: undefined reference for user build package

조회 수: 28 (최근 30일)
Economist_101
Economist_101 2019년 7월 15일
편집: Jan 2019년 7월 17일
I run into the the following issue when I try to compile a user-build mex function :
>> mex kalcvf.c
Building with 'gcc'.
Error using mex
/tmp/mex_40203179616654_15298/kalcvf.o: In function `kalcvf':
kalcvf.c:(.text+0x120): undefined reference to `dcopy_'
(...)
the folder includes several files, such as
dlyap.c
kalcvf.c
kalcvf.def
kalcvf.vcproj
kalcvf.vcxproj
kalcvf.filters
kalcvf.user
matlib.c
matlib.h
and in a parent directory
mex.ncb
mex.sdf
mex.sln
What additional steps do I need to take in order to compile the mex function?
  댓글 수: 4
Jan
Jan 2019년 7월 17일
편집: Jan 2019년 7월 17일
mex -v -R2017b yourFcn.c -lmwblas
[MOVED to the section for answers]
Economist_101
Economist_101 2019년 7월 17일
Perfect, this did the trick:
mex -v -R2018a kalcvf/kalcvf.c kalcvf/dlyap.c kalcvf/matlib.c -lmwblas -lmwlapack

댓글을 달려면 로그인하십시오.

채택된 답변

Jan
Jan 2019년 7월 17일

추가 답변 (1개)

James Tursa
James Tursa 2019년 7월 16일
Try looking in the MATLAB/R2019a/extern/lib folder for versions of these files appropriate for your system. They might have slightly different names than above, but should have lapack and blas as part of the names.

카테고리

Help CenterFile Exchange에서 Write 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