undefined reference to `cv::imwrite

asked 2018-06-15 01:43:23 -0600

enviroment:Audio Studio 3.1.2,Android 8.0,opencvforAndroid341。 Use C++ to call opencv libs,and compile : undefined reference to `cv::imwrite(cv::String const&, cv::_InputArray const&, std::__ndk1::vector<int, std::__ndk1::allocator<int=""> > const&)',I don't know why,Have anyone ever met this problem? Thanks!

edit retag flag offensive close merge delete

Comments

audio studio, really ?

and you compiled some c++ code, but failed to link nessecary opencv libs like opencv_imgcodecs

berak gravatar imageberak ( 2018-06-15 02:13:05 -0600 )edit

yes,but i have include opencv_imgcodecs,imread function no problem。

oclearner gravatar imageoclearner ( 2018-06-15 02:21:15 -0600 )edit

including headers is nessecary for the compile step, but now you have to link the resp. library to your program.

berak gravatar imageberak ( 2018-06-15 02:36:06 -0600 )edit
1

no,if not include library,imread will undefined reference too。

oclearner gravatar imageoclearner ( 2018-06-15 03:05:11 -0600 )edit

oh,right. wrong analysis on my side, then. (did not see the imread comment, sorry.)

berak gravatar imageberak ( 2018-06-15 05:58:28 -0600 )edit

std::__ndk1::vector <-- what on earth is this ? opencv does not use it

related (unanswered) question

might be , you're using the wrong stl implementation ?

berak gravatar imageberak ( 2018-06-15 06:02:09 -0600 )edit

I'm not sure where can i config the right stl implementation?Thanks!

oclearner gravatar imageoclearner ( 2018-06-18 22:25:46 -0600 )edit

It‘s OK now,Thanks。’

oclearner gravatar imageoclearner ( 2018-06-21 20:56:35 -0600 )edit

@oclearner so, how did you solve it? can you share with me? i believe i encountered the same issue, many thanks!

shelpermisc gravatar imageshelpermisc ( 2018-07-19 13:21:53 -0600 )edit

can you tell me how to fix this issue, thanks.

Meng2018 gravatar imageMeng2018 ( 2018-10-18 08:18:28 -0600 )edit