필터 지우기
필터 지우기

Error using MEX for C++ function in Matlab : error LNK2019: unresolved external symbol.

조회 수: 3 (최근 30일)
Hi,
Im trying to compile a C++ algorithm but with many hurdles...
I found this error is very common and there are lots of links with similar questions; but I tried many modifications in the code and in the sentence when you call mex, but with any results.
My knowledge on C/C++ is little.
If you could please help me , thanks in advance.
I attach all my codes. Now they are all in the same folder, no space in the path names. Im neither loading no libraries with .lib. Just .cpp and .h files. Can't understand what's going wrong. Quite desperating.
The Main .cpp which Im trying to compile is algo.cpp , the rest of them are functions that are called from algo.cpp:
Heres my Error:
Error using mex Creating library algo.lib and object algo.exp algo.obj : error LNK2019: unresolved external symbol "public: float * __cdecl CImage::get_channel(int)" (?get_channel@CImage@@QEAAPEAMH@Z) referenced in function "unsigned int __cdecl buildMask(class CImage &,int *,unsigned int,unsigned int,unsigned int,unsigned int)" (?buildMask@@YAIAEAVCImage@@PEAHIIII@Z) algo.obj : error LNK2019: unresolved external symbol "public: __cdecl CImage::~CImage(void)" (??1CImage@@QEAA@XZ) referenced in function "void __cdecl algorithm(int,char * *)" (?algorithm@@YAXHPEAPEAD@Z) algo.obj : error LNK2019: unresolved external symbol fftwf_cleanup referenced in function "void __cdecl algorithm(int,char * *)" (?algorithm@@YAXHPEAPEAD@Z) algo.obj : error LNK2019: unresolved external symbol fftwf_cleanup_threads referenced in function "void __cdecl algorithm(int,char * *)" (?algorithm@@YAXHPEAPEAD@Z) algo.obj : error LNK2019: unresolved external symbol fftwf_destroy_plan referenced in function "void __cdecl algorithm(int,char * *)" (?algorithm@@YAXHPEAPEAD@Z) algo.obj : error LNK2019: unresolved external symbol "void __cdecl filter_curve(float *,float *,int,float *,int,bool)" (?filter_curve@@YAXPEAM0H0H_N@Z) referenced in function "void __cdecl algorithm(int,char * *)" (?algorithm@@YAXHPEAPEAD@Z)
  댓글 수: 1
Geoff Hayes
Geoff Hayes 2015년 7월 15일
Sebastien - you are probably missing one or more libraries that reference the the CImage class and the fftwf_ code. Rather than attaching a zip file (which many people might be reluctant to open) why not just attach the files? (Or are there too many to do that?)
Also, please describe how you are compiling your mex function.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 C Shared Library Integration에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by