error LNK2019: unresolved external symbol in matlab

4 views (last 30 days)
I have been at this for 2 days and have tried every possible solution I can find in google. But I still am stuck here.
I downloaded a package for superpixel implementation from http://www.mvdblive.org/seeds/
The function is in c++, but a mex file has been generated for a linux 64 bit OS. Am using windows 8 64 bit, so I have to generate one mex file for my system.
The files are already provided in the package from the site. After mex setup and providing proper openCV paths and environment variables, I ran the code compile_mex.m
mex -IB:\Opencv\opencv\build\include\opencv -c seeds2.cpp
mex mexSEEDS.cpp -IB:\Opencv\opencv\build\include\opencv seeds2.obj
And I get the following error, for which am not able to arrive at a solution
mexSEEDS.obj : error LNK2019: unresolved external symbol cvSaveImage referenced in function "void __cdecl SaveImage(unsigned int *,int const &,int const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?SaveImage@@YAXPEAIAEBH1AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
I have not been able to pass through this. I got the same error when I executed this in codeblocks, even after linking the libraires, compiler directories and the linker libraires and directories as suggested by many sites/forums. I can provide more information as you would need to debug this one. Please help along with me to solve this. Its pretty urgent. And thanks in advance.

Answers (1)

Ken Atwell
Ken Atwell on 30 Apr 2014
You likely need to use -L and -l (upper and lower case "L") to indicate to the OpenCV library folder and library name.

Categories

Find more on MATLAB Compiler in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!