Hi ,
I am trying to compile one of basic c++ application[get opencv version] using opencv static library.
I have followed below procedure.
- Clone the opencv source code.
- "cmake -DBUILD_SHARED_LIBS=OFF " to build only static libraries.
- Copied the libopencv_core.a to my application folder.
- Compiling the application as below.
command: g++ test.cpp -o test -L. -lopencv_core
**Output: **
/tmp/ccmVzIw6.o: In functioncv::String::~String()':** **test.cpp:(.text._ZN2cv6StringD2Ev[_ZN2cv6StringD5Ev]+0x14): undefined reference to
cv::String::deallocate()'
/tmp/ccmVzIw6.o: In functioncv::String::operator=(cv::String const&)':** **test.cpp:(.text._ZN2cv6StringaSERKS0_[_ZN2cv6StringaSERKS0_]+0x28): undefined reference to
cv::String::deallocate()'
collect2: error: ld returned 1 exit status
Any suggestion, how can i compile an application using opencv static library. I dont want to install the opencv to my laptop/board.
Thanks & regards
Surya