compile Opencv as static library (Feature #1540)


Added by caron liyan about 13 years ago. Updated almost 13 years ago.


Status:Cancelled Start date:
Priority:Blocker Due date:
Assignee:Vadim Pisarevsky % Done:

0%

Category:build/install
Target version:2.4.0
Difficulty: Pull request:

Description

I compile the opencv with:
cmake -D WITH_FFMPEG=OFF \
-D BUILD_SHARED_LIBS=OFF \
-D BUILD_PYTHON_SUPPORT=OFF \
-D CMAKE_BUILD_TYPE=RELEASE \
-D BUILD_DOCS=OFF \
-D BUILD_EXAMPLES=OFF \
-D BUILD_NEW_PYTHON_SUPPORT=OFF \
-D BUILD_TESTS=OFF \
-D CMAKE_INSTALL_PREFIX= \
-D OPENCV_EXTRA_C_FLAGS= \
-D OPENCV_BUILD_3RDPARTY_LIBS=ON \
-D WITH_JPEG=ON \
-D WITH_JASPER=ON \
-D WITH_TIFF=ON \
-D WITH_PNG=ON \
-D WITH_FFMPEG=OFF \
-D WITH_CUDA=OFF \
-D WITH_GTK=OFF.
But we I use the .a lib, I found

test.cpp:(.text+0xeb): undefined reference to @cv::imshow(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cv::Mat const&)'
/home/liyan/lib/libcv/out//libopencv_highgui.a(grfmt_tiff.o): In function @cv::TiffDecoder::close()':
grfmt_tiff.cpp:(.text._ZN2cv11TiffDecoder5closeEv+0x13): undefined reference to @TIFFClose'
/home/liyan/lib/libcv/out//libopencv_highgui.a(grfmt_tiff.o): In function @cv::TiffDecoder::readData(cv::Mat&)':
grfmt_tiff.cpp:(.text._ZN2cv11TiffDecoder8readDataERNS_3MatE+0x8c): undefined reference to @TIFFClose'
grfmt_tiff.cpp:(.text._ZN2cv11TiffDecoder8readDataERNS_3MatE+0xe1): undefined reference to @TIFFIsTiled'
grfmt_tiff.cpp:(.text._ZN2cv11TiffDecoder8readDataERNS_3MatE+0x107): undefined reference to @TIFFGetField'
grfmt_tiff.cpp:(.text._ZN2cv11TiffDecoder8readDataERNS_3MatE+0x149): undefined reference to @TIFFGetField'
grfmt_tiff.cpp:(.text._ZN2cv11TiffDecoder8readDataERNS_3MatE+0x168): undefined reference to @TIFFGetField'
grfmt_tiff.cpp:(.text._ZN2cv11TiffDecoder8readDataERNS_3MatE+0x1b8): undefined reference to @TIFFGetField'
grfmt_tiff.cpp:(.text._ZN2cv11TiffDecoder8readDataERNS_3MatE+0x200): undefined reference to @TIFFGetField'
grfmt_tiff.cpp:(.text._ZN2cv11TiffDecoder8readDataERNS_3MatE+0x394): undefined reference to @TIFFReadEncodedStrip'
grfmt_tiff.cpp:(.text._ZN2cv11TiffDecoder8readDataERNS_3MatE+0x4aa): undefined reference to @TIFFReadRGBAStrip'
grfmt_tiff.cpp:(.text._ZN2cv11TiffDecoder8readDataERNS_3MatE+0x592): undefined reference to @TIFFReadEncodedStrip'
grfmt_tiff.cpp:(.text._ZN2cv11TiffDecoder8readDataERNS_3MatE+0x7bb): undefined reference to @TIFFReadEncodedTile'
grfmt_tiff.cpp:(.text._ZN2cv11TiffDecoder8readDataERNS_3MatE+0x7e7): undefined reference to @TIFFReadEncodedTile'
grfmt_tiff.cpp:(.text._ZN2cv11TiffDecoder8readDataERNS_3MatE+0x813): undefined reference to @TIFFReadRGBATile'
grfmt_tiff.cpp:(.text._ZN2cv11TiffDecoder8readDataERNS_3MatE+0x897): undefined reference to @TIFFRGBAImageOK'
......


Associated revisions

Revision 21233656
Added by Roman Donchenko over 11 years ago

Merge pull request #1540 from jet47:gpuarithm-cudev

History

Updated by Vadim Pisarevsky about 13 years ago

when you build opencv as static library, do not forget to add libtiff and other such libs to your linker settings.

  • Status changed from Open to Done
  • (deleted custom field) set to invalid

Updated by Andrey Kamaev about 13 years ago

  • Status changed from Done to Cancelled

Updated by Andrey Kamaev almost 13 years ago

  • Target version set to 2.4.0

Also available in: Atom PDF