Ask Your Question
0

3.10 ml::EM linker error

asked 2016-04-01 16:04:28 -0600

traz64 gravatar image

When I uncomment the second line here I get an error LNK2019, but it works with the first line in there. I have not had this issue before with opencv (although I haven't used anything from the ml library before). In my linker inputs I have opencv_wrold310.lib

Is there some other file I need to add to my linker? or am I just not calling setClustersNumber correctly?

    ml::EM * test=ml::EM::create();

   //test->ml::EM::setClustersNumber(9);

full error:

Error LNK2019 unresolved external symbol "public: virtual void __cdecl cv::ml::EM::setClustersNumber(int)" (?setClustersNumber@EM@ml@cv@@UEAAXH@Z) referenced in function "class cv::Mat __cdecl gmm(class cv::Mat,class cv::Mat,class cv::Mat,int)" (?gmm@@YA?AVMat@cv@@V12@00H@Z) ConsoleApplication1 C:\Users\Traz\Documents\Visual Studio 2015\Projects\ConsoleApplication1\ConsoleApplication1\Source.obj

Using VS2015

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2016-04-02 02:32:55 -0600

berak gravatar image

1.: please do not use a raw pointer(it will self-destroy then), but a cv::Ptr. your first line has to be:

Ptr<ml::EM> test=ml::EM::create();

2.: you have to use the implementation, not the (pure)virtual interface method:

test->setClustersNumber(9);
edit flag offensive delete link more

Comments

Thank you!

traz64 gravatar imagetraz64 ( 2016-04-02 07:05:40 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2016-04-01 16:04:28 -0600

Seen: 248 times

Last updated: Apr 02 '16