ARM的Opencv静态库链接器错误

时间:2014-06-23 16:52:37

标签: c++ opencv arm static-libraries

大家好我的静态图书馆链接有问题。我在ubuntu 12.0.4中执行c ++应用程序,我必须为ARM创建此.cpp文件的执行。该文件包含opencv库。

所以我做的第一件事就是从git仓库下载opencv源代码:

git clone https://github.com/Itseez/opencv.git

完成后没有问题,我创建了一个新目录并执行了Cmake:

cmake -DSOFTFP = ON -DBUILD_SHARED_LIBS = 0 -DCMAKE_TOOLCHAIN_FILE = .. / opencv / platforms / linux / arm-gnueabi.toolchain.cmake ../ opencv

然后我执行make,并开始为ARM构建静态opencv库。一切都很好,我可以看到刚刚创建的静态库。

所以我尝试像这样编译:

arm-linux-g ++ -static -o camera IpCamPthread.cpp -I / usr / local / include -L / home / jesus / opencv / build / lib -lopencv_core -lopencv_imgproc -lopencv_highgui

然后出现此错误:

    /home/jesus/opencv/build/lib/libopencv_core.a(rand.cpp.o): In function `cv::theRNG()':
    rand.cpp:(.text._ZN2cv6theRNGEv+0xe): undefined reference to `pthread_once'
    rand.cpp:(.text._ZN2cv6theRNGEv+0x18): undefined reference to `pthread_getspecific'
    rand.cpp:(.text._ZN2cv6theRNGEv+0x3e): undefined reference to `pthread_setspecific'
    /home/jesus/opencv/build/lib/libopencv_core.a(rand.cpp.o): In function       `cv::makeRNGKey()':    
    rand.cpp:(.text._ZN2cvL10makeRNGKeyEv+0x14): undefined reference to `pthread_key_create'
    /home/jesus/opencv/build/lib/libopencv_core.a(system.cpp.o): In function     `cv::Mutex::trylock()':
    system.cpp:(.text._ZN2cv5Mutex7trylockEv+0x4): undefined reference to     `pthread_spin_trylock'    
    /home/jesus/opencv/build/lib/libopencv_core.a(system.cpp.o): In function     `cv::Mutex::unlock()':     
    system.cpp:(.text._ZN2cv5Mutex6unlockEv+0x4): undefined reference to   `pthread_spin_unlock'   
    /home/jesus/opencv/build/lib/libopencv_core.a(system.cpp.o): In function    `cv::Mutex::lock()':    
system.cpp:(.text._ZN2cv5Mutex4lockEv+0x4): undefined reference to `pthread_spin_lock'
/home/jesus/opencv/build/lib/libopencv_core.a(system.cpp.o): In function `cv::Mutex::operator=(cv::Mutex const&)':
system.cpp:(.text._ZN2cv5MutexaSERKS0_+0x34): undefined reference to `pthread_spin_destroy'
/home/jesus/opencv/build/lib/libopencv_core.a(system.cpp.o): In function `cv::Mutex::~Mutex()':
system.cpp:(.text._ZN2cv5MutexD1Ev+0x28): undefined reference to `pthread_spin_destroy'
/home/jesus/opencv/build/lib/libopencv_core.a(system.cpp.o): In function `cv::Mutex::~Mutex()':
system.cpp:(.text._ZN2cv5MutexD2Ev+0x28): undefined reference to `pthread_spin_destroy'
/home/jesus/opencv/build/lib/libopencv_core.a(system.cpp.o): In function `cv::Mutex::Mutex()':
system.cpp:(.text._ZN2cv5MutexC1Ev+0xe): undefined reference to `pthread_spin_init'
/home/jesus/opencv/build/lib/libopencv_core.a(system.cpp.o): In function `cv::Mutex::Mutex()':
system.cpp:(.text._ZN2cv5MutexC2Ev+0xe): undefined reference to `pthread_spin_init'
/home/jesus/opencv/build/lib/libopencv_core.a(system.cpp.o): In function `cv::getTickCount()':
system.cpp:(.text._ZN2cv12getTickCountEv+0x8): undefined reference to `clock_gettime'
/home/jesus/opencv/build/lib/libopencv_core.a(system.cpp.o): In function `cv::makeKey()':
system.cpp:(.text._ZN2cvL7makeKeyEv+0x14): undefined reference to `pthread_key_create'
/home/jesus/opencv/build/lib/libopencv_core.a(system.cpp.o): In function `cv::TLSDataContainer::getData() const':
system.cpp:(.text._ZNK2cv16TLSDataContainer7getDataEv+0x20): undefined reference to `pthread_once'
system.cpp:(.text._ZNK2cv16TLSDataContainer7getDataEv+0x26): undefined reference to `pthread_getspecific'
system.cpp:(.text._ZNK2cv16TLSDataContainer7getDataEv+0x156): undefined reference to `pthread_setspecific'
/home/jesus/opencv/build/lib/libopencv_core.a(persistence.cpp.o): In function `icvGets(CvFileStorage*, char*, int)':
persistence.cpp:(.text._ZL7icvGetsP13CvFileStoragePci+0x94): undefined reference to `gzgets'
/home/jesus/opencv/build/lib/libopencv_core.a(persistence.cpp.o): In function `icvXMLSkipSpaces(CvFileStorage*, char*, int)':
persistence.cpp:(.text._ZL16icvXMLSkipSpacesP13CvFileStoragePci+0x1b4): undefined reference to `gzeof'
/home/jesus/opencv/build/lib/libopencv_core.a(persistence.cpp.o): In function `T.3388':
persistence.cpp:(.text.T.3388+0x11c): undefined reference to `gzeof'
/home/jesus/opencv/build/lib/libopencv_core.a(persistence.cpp.o): In function `icvPuts(CvFileStorage*, char const*)':
persistence.cpp:(.text._ZL7icvPutsP13CvFileStoragePKc+0x150): undefined reference to `gzputs'
/home/jesus/opencv/build/lib/libopencv_core.a(persistence.cpp.o): In function `icvClose(CvFileStorage*, std::basic_string<char, std::char_traits<char>, std::allocator<char> >*)':
persistence.cpp:(.text._ZL8icvCloseP13CvFileStoragePSs+0x136): undefined reference to `gzclose'
/home/jesus/opencv/build/lib/libopencv_core.a(persistence.cpp.o): In function `cvOpenFileStorage':
persistence.cpp:(.text.cvOpenFileStorage+0x7d0): undefined reference to `gzrewind'
persistence.cpp:(.text.cvOpenFileStorage+0x80c): undefined reference to `gzclose'
persistence.cpp:(.text.cvOpenFileStorage+0x88e): undefined reference to `gzopen'
persistence.cpp:(.text.cvOpenFileStorage+0xe3e): undefined reference to `gzclose'
/home/jesus/opencv/build/lib/libopencv_highgui.a(grfmt_png.cpp.o): In function `cv::PngEncoder::writeDataToBuf(void*, unsigned char*, unsigned int)':
grfmt_png.cpp:(.text._ZN2cv10PngEncoder14writeDataToBufEPvPhj+0x28): undefined reference to `png_get_io_ptr'
/home/jesus/opencv/build/lib/libopencv_highgui.a(grfmt_png.cpp.o): In function `cv::PngDecoder::readDataFromBuf(void*, unsigned char*, unsigned int)':
grfmt_png.cpp:(.text._ZN2cv10PngDecoder15readDataFromBufEPvPhj+0x14): undefined reference to `png_get_io_ptr'
grfmt_png.cpp:(.text._ZN2cv10PngDecoder15readDataFromBufEPvPhj+0xec): undefined reference to `png_error'
/home/jesus/opencv/build/lib/libopencv_highgui.a(grfmt_png.cpp.o): In function `cv::PngDecoder::close()':
grfmt_png.cpp:(.text._ZN2cv10PngDecoder5closeEv+0x2a): undefined reference to `png_destroy_read_struct'
/home/jesus/opencv/build/lib/libopencv_highgui.a(grfmt_png.cpp.o): In function `cv::PngDecoder::readHeader()':
grfmt_png.cpp:(.text._ZN2cv10PngDecoder10readHeaderEv+0x1c): undefined reference to `png_create_read_struct'
grfmt_png.cpp:(.text._ZN2cv10PngDecoder10readHeaderEv+0x26): undefined reference to `png_create_info_struct'
grfmt_png.cpp:(.text._ZN2cv10PngDecoder10readHeaderEv+0x2e): undefined reference to `png_create_info_struct'
grfmt_png.cpp:(.text._ZN2cv10PngDecoder10readHeaderEv+0x66): undefined reference to `png_set_longjmp_fn'
grfmt_png.cpp:(.text._ZN2cv10PngDecoder10readHeaderEv+0xb2): undefined reference to `png_init_io'
grfmt_png.cpp:(.text._ZN2cv10PngDecoder10readHeaderEv+0xe0): undefined reference to `png_read_info'
grfmt_png.cpp:(.text._ZN2cv10PngDecoder10readHeaderEv+0xfa): undefined reference to `png_get_IHDR'
grfmt_png.cpp:(.text._ZN2cv10PngDecoder10readHeaderEv+0x166): undefined reference to `png_set_read_fn'
grfmt_png.cpp:(.text._ZN2cv10PngDecoder10readHeaderEv+0x180): undefined reference to `png_get_tRNS'
/home/jesus/opencv/build/lib/libopencv_highgui.a(grfmt_png.cpp.o): In function `cv::PngEncoder::write(cv::Mat const&, std::vector<int, std::allocator<int> > const&)':
grfmt_png.cpp:(.text._ZN2cv10PngEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x26): undefined reference to `png_create_write_struct'
grfmt_png.cpp:(.text._ZN2cv10PngEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x68): undefined reference to `png_create_info_struct'
grfmt_png.cpp:(.text._ZN2cv10PngEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x88): undefined reference to `png_set_longjmp_fn'
grfmt_png.cpp:(.text._ZN2cv10PngEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0xb2): undefined reference to `png_set_write_fn'
grfmt_png.cpp:(.text._ZN2cv10PngEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x13c): undefined reference to `png_set_compression_level'
grfmt_png.cpp:(.text._ZN2cv10PngEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x148): undefined reference to `png_set_compression_strategy'
grfmt_png.cpp:(.text._ZN2cv10PngEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x18a): undefined reference to `png_set_IHDR'
grfmt_png.cpp:(.text._ZN2cv10PngEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x19a): undefined reference to `png_write_info'
grfmt_png.cpp:(.text._ZN2cv10PngEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x1aa): undefined reference to `png_set_packing'
grfmt_png.cpp:(.text._ZN2cv10PngEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x1b4): undefined reference to `png_set_bgr'
grfmt_png.cpp:(.text._ZN2cv10PngEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x1c8): undefined reference to `png_set_swap'
grfmt_png.cpp:(.text._ZN2cv10PngEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x22e): undefined reference to `png_write_image'
grfmt_png.cpp:(.text._ZN2cv10PngEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x23e): undefined reference to `png_write_end'
grfmt_png.cpp:(.text._ZN2cv10PngEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x252): undefined reference to `png_destroy_write_struct'
grfmt_png.cpp:(.text._ZN2cv10PngEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x2e0): undefined reference to `png_init_io'
grfmt_png.cpp:(.text._ZN2cv10PngEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x2f8): undefined reference to `png_set_filter'
grfmt_png.cpp:(.text._ZN2cv10PngEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x304): undefined reference to `png_set_compression_level'
/home/jesus/opencv/build/lib/libopencv_highgui.a(grfmt_png.cpp.o): In function `cv::PngDecoder::readData(cv::Mat&)':
grfmt_png.cpp:(.text._ZN2cv10PngDecoder8readDataERNS_3MatE+0x9e): undefined reference to `png_set_longjmp_fn'
grfmt_png.cpp:(.text._ZN2cv10PngDecoder8readDataERNS_3MatE+0xf8): undefined reference to `png_set_gray_to_rgb'
grfmt_png.cpp:(.text._ZN2cv10PngDecoder8readDataERNS_3MatE+0xfe): undefined reference to `png_set_interlace_handling'
grfmt_png.cpp:(.text._ZN2cv10PngDecoder8readDataERNS_3MatE+0x106): undefined reference to `png_read_update_info'
grfmt_png.cpp:(.text._ZN2cv10PngDecoder8readDataERNS_3MatE+0x128): undefined reference to `png_read_image'
grfmt_png.cpp:(.text._ZN2cv10PngDecoder8readDataERNS_3MatE+0x130): undefined reference to `png_read_end'
grfmt_png.cpp:(.text._ZN2cv10PngDecoder8readDataERNS_3MatE+0x14c): undefined reference to `png_set_rgb_to_gray'
grfmt_png.cpp:(.text._ZN2cv10PngDecoder8readDataERNS_3MatE+0x160): undefined reference to `png_set_bgr'
grfmt_png.cpp:(.text._ZN2cv10PngDecoder8readDataERNS_3MatE+0x168): undefined reference to `png_set_strip_alpha'
grfmt_png.cpp:(.text._ZN2cv10PngDecoder8readDataERNS_3MatE+0x174): undefined reference to `png_set_swap'
grfmt_png.cpp:(.text._ZN2cv10PngDecoder8readDataERNS_3MatE+0x180): undefined reference to `png_set_expand_gray_1_2_4_to_8'
grfmt_png.cpp:(.text._ZN2cv10PngDecoder8readDataERNS_3MatE+0x188): undefined reference to `png_set_strip_16'
grfmt_png.cpp:(.text._ZN2cv10PngDecoder8readDataERNS_3MatE+0x194): undefined reference to `png_set_palette_to_rgb'
/home/jesus/opencv/build/lib/libopencv_highgui.a(grfmt_jpeg2000.cpp.o): In function `global constructors keyed to grfmt_jpeg2000.cpp':
grfmt_jpeg2000.cpp:(.text._GLOBAL__I_grfmt_jpeg2000.cpp+0x4): undefined reference to `jas_init'
/home/jesus/opencv/build/lib/libopencv_highgui.a(grfmt_jpeg2000.cpp.o): In function `cv::JasperInitializer::~JasperInitializer()':
grfmt_jpeg2000.cpp:(.text._ZN2cv17JasperInitializerD1Ev[cv::JasperInitializer::~JasperInitializer()]+0x4): undefined reference to `jas_cleanup'
/home/jesus/opencv/build/lib/libopencv_highgui.a(grfmt_jpeg2000.cpp.o): In function `cv::Jpeg2KEncoder::writeComponent16u(void*, cv::Mat const&)':
grfmt_jpeg2000.cpp:(.text._ZN2cv13Jpeg2KEncoder17writeComponent16uEPvRKNS_3MatE+0x1e): undefined reference to `jas_matrix_create'
grfmt_jpeg2000.cpp:(.text._ZN2cv13Jpeg2KEncoder17writeComponent16uEPvRKNS_3MatE+0xa4): undefined reference to `jas_image_writecmpt'
grfmt_jpeg2000.cpp:(.text._ZN2cv13Jpeg2KEncoder17writeComponent16uEPvRKNS_3MatE+0xbe): undefined reference to `jas_matrix_destroy'
/home/jesus/opencv/build/lib/libopencv_highgui.a(grfmt_jpeg2000.cpp.o): In function `cv::Jpeg2KEncoder::writeComponent8u(void*, cv::Mat const&)':
grfmt_jpeg2000.cpp:(.text._ZN2cv13Jpeg2KEncoder16writeComponent8uEPvRKNS_3MatE+0x1e): undefined reference to `jas_matrix_create'
grfmt_jpeg2000.cpp:(.text._ZN2cv13Jpeg2KEncoder16writeComponent8uEPvRKNS_3MatE+0xa4): undefined reference to `jas_image_writecmpt'
grfmt_jpeg2000.cpp:(.text._ZN2cv13Jpeg2KEncoder16writeComponent8uEPvRKNS_3MatE+0xbe): undefined reference to `jas_matrix_destroy'
/home/jesus/opencv/build/lib/libopencv_highgui.a(grfmt_jpeg2000.cpp.o): In function `cv::Jpeg2KEncoder::write(cv::Mat const&, std::vector<int, std::allocator<int> > const&)':
grfmt_jpeg2000.cpp:(.text._ZN2cv13Jpeg2KEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x64): undefined reference to `jas_image_create'
grfmt_jpeg2000.cpp:(.text._ZN2cv13Jpeg2KEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x9e): undefined reference to `jas_image_destroy'
grfmt_jpeg2000.cpp:(.text._ZN2cv13Jpeg2KEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0xd0): undefined reference to `jas_stream_fopen'
grfmt_jpeg2000.cpp:(.text._ZN2cv13Jpeg2KEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0xde): undefined reference to `jas_image_strtofmt'
grfmt_jpeg2000.cpp:(.text._ZN2cv13Jpeg2KEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0xec): undefined reference to `jas_image_encode'
grfmt_jpeg2000.cpp:(.text._ZN2cv13Jpeg2KEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0xf6): undefined reference to `jas_stream_close'
/home/jesus/opencv/build/lib/libopencv_highgui.a(grfmt_jpeg2000.cpp.o): In function `cv::Jpeg2KDecoder::close()':
grfmt_jpeg2000.cpp:(.text._ZN2cv13Jpeg2KDecoder5closeEv+0xa): undefined reference to `jas_stream_close'
grfmt_jpeg2000.cpp:(.text._ZN2cv13Jpeg2KDecoder5closeEv+0x18): undefined reference to 
grfmt_jpeg2000.cpp:(.text._ZN2cv13Jpeg2KDecoder8readDataERNS_3MatE+0x94): undefined reference to `jas_image_getcmptbytype'
grfmt_jpeg2000.cpp:(.text._ZN2cv13Jpeg2KDecoder8readDataERNS_3MatE+0x118): undefined reference to `jas_matrix_destroy'
grfmt_jpeg2000.cpp:(.text._ZN2cv13Jpeg2KDecoder8readDataERNS_3MatE+0x172): undefined reference to `jas_matrix_create'
grfmt_jpeg2000.cpp:(.text._ZN2cv13Jpeg2KDecoder8readDataERNS_3MatE+0x18c): undefined reference to `jas_image_readcmpt'
grfmt_jpeg2000.cpp:(.text._ZN2cv13Jpeg2KDecoder8readDataERNS_3MatE+0x1ae): undefined reference to `jas_cmprof_createfromclrspc'
grfmt_jpeg2000.cpp:(.text._ZN2cv13Jpeg2KDecoder8readDataERNS_3MatE+0x1be): undefined reference to `jas_image_chclrspc'
grfmt_jpeg2000.cpp:(.text._ZN2cv13Jpeg2KDecoder8readDataERNS_3MatE+0x1ca): undefined reference to `jas_image_destroy'
grfmt_jpeg2000.cpp:(.text._ZN2cv13Jpeg2KDecoder8readDataERNS_3MatE+0x1d4): undefined reference to `jas_cmprof_destroy'
grfmt_jpeg2000.cpp:(.text._ZN2cv13Jpeg2KDecoder8readDataERNS_3MatE+0x246): undefined reference to `jas_cmprof_destroy'
/home/jesus/opencv/build/lib/libopencv_highgui.a(grfmt_jpeg2000.cpp.o): In function `cv::Jpeg2KDecoder::readHeader()':
grfmt_jpeg2000.cpp:(.text._ZN2cv13Jpeg2KDecoder10readHeaderEv+0x12): undefined reference to `jas_stream_fopen'
grfmt_jpeg2000.cpp:(.text._ZN2cv13Jpeg2KDecoder10readHeaderEv+0x22): undefined reference to `jas_image_decode'
/home/jesus/opencv/build/lib/libopencv_highgui.a(grfmt_jpeg.cpp.o): In function `cv::JpegEncoder::write(cv::Mat const&, std::vector<int, std::allocator<int> > const&)':
grfmt_jpeg.cpp:(.text._ZN2cv11JpegEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x7c): undefined reference to `jpeg_CreateCompress'
grfmt_jpeg.cpp:(.text._ZN2cv11JpegEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x84): undefined reference to `jpeg_std_error'
grfmt_jpeg.cpp:(.text._ZN2cv11JpegEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x158): undefined reference to `jpeg_set_defaults'
grfmt_jpeg.cpp:(.text._ZN2cv11JpegEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x164): 
/home/jesus/opencv/build/lib/libopencv_highgui.a(grfmt_jpeg.cpp.o): In function `T.441':
grfmt_jpeg.cpp:(.text.T.441+0x162): undefined reference to `jpeg_alloc_huff_table'
/home/jesus/opencv/build/lib/libopencv_highgui.a(grfmt_jpeg.cpp.o): In function `cv::JpegDecoder::readData(cv::Mat&)':
grfmt_jpeg.cpp:(.text._ZN2cv11JpegDecoder8readDataERNS_3MatE+0x9a): undefined reference to `jpeg_start_decompress'
grfmt_jpeg.cpp:(.text._ZN2cv11JpegDecoder8readDataERNS_3MatE+0x108): undefined reference to `jpeg_read_scanlines'
grfmt_jpeg.cpp:(.text._ZN2cv11JpegDecoder8readDataERNS_3MatE+0x132): undefined reference to `jpeg_finish_decompress'
grfmt_jpeg.cpp:(.text._ZN2cv11JpegDecoder8readDataERNS_3MatE+0x17c): undefined reference to `jpeg_read_scanlines'
/home/jesus/opencv/build/lib/libopencv_highgui.a(grfmt_exr.cpp.o): In function `cv::ExrDecoder::readHeader()':
grfmt_exr.cpp:(.text._ZN2cv10ExrDecoder10readHeaderEv+0xa): undefined reference to `Imf::globalThreadCount()'
grfmt_exr.cpp:(.text._ZN2cv10ExrDecoder10readHeaderEv+0x20): undefined reference to `Imf::InputFile::InputFile(char const*, int)'
grfmt_exr.cpp:(.text._ZN2cv10ExrDecoder10readHeaderEv+0x2e): undefined reference to `Imf::InputFile::header() const'
grfmt_exr.cpp:(.text._ZN2cv10ExrDecoder10readHeaderEv+0x32): undefined reference to `Imf::Header::dataWindow() const'
grfmt_exr.cpp:(.text._ZN2cv10ExrDecoder10readHeaderEv+0x5a): undefined reference to `Imf::InputFile::header() const'
grfmt_exr.cpp:(.text._ZN2cv10ExrDecoder10readHeaderEv+0x5e): undefined reference to `Imf::hasChromaticities(Imf::Header const&)'
grfmt_exr.cpp:(.text._ZN2cv10ExrDecoder10readHeaderEv+0x68): undefined reference to `Imf::InputFile::header() const'
grfmt_exr.cpp:(.text._ZN2cv10ExrDecoder10readHeaderEv+0x6c): undefined reference to `Imf::Header::channels() const'
grfmt_exr.cpp:(.text._ZN2cv10ExrDecoder10readHeaderEv+0x76): undefined reference to `Imf::ChannelList::findChannel(char const*) const'
grfmt_exr.cpp:(.text._ZN2cv10ExrDecoder10readHeaderEv+0x82): undefined reference to `Imf::ChannelList::findChannel(char const*) const'
grfmt_exr.cpp:(.text._ZN2cv10ExrDecoder10readHeaderEv+0x8e): undefined reference to `Imf::ChannelList::findChannel(char const*) const'
grfmt_exr.cpp:(.text._ZN2cv10ExrDecoder10readHeaderEv+0xf2): undefined reference to `Imf::InputFile::header() const'
grfmt_exr.cpp:(.text._ZN2cv10ExrDecoder10readHeaderEv+0xf6): undefined reference to `Imf::chromaticities(Imf::Header const&)'
grfmt_exr.cpp:(.text._ZN2cv10ExrDecoder10readHeaderEv+0x144): undefined reference to `Imf::ChannelList::findChannel(char const*) const'
grfmt_exr.cpp:(.text._ZN2cv10ExrDecoder10readHeaderEv+0x15a): undefined reference to `Imf::ChannelList::findChannel(char const*) const'
grfmt_exr.cpp:(.text._ZN2cv10ExrDecoder10readHeaderEv+0x166): undefined reference to `Imf::ChannelList::findChannel(char const*) const'
/home/jesus/opencv/build/lib/libopencv_highgui.a(grfmt_exr.cpp.o): In function `cv::ExrEncoder::write(cv::Mat const&, std::vector<int, std::allocator<int> > const&)':
grfmt_exr.cpp:(.text._ZN2cv10ExrEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x70): undefined reference to `Imf::Header::Header(int, int, float, Imath::Vec2<float> const&, float, Imf::LineOrder, Imf::Compression)'
grfmt_exr.cpp:(.text._ZN2cv10ExrEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x96): undefined reference to `Imf::Header::channels()'
grfmt_exr.cpp:(.text._ZN2cv10ExrEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0xaa): undefined reference to `Imf::Channel::Channel(Imf::PixelType, int, int, bool)'
grfmt_exr.cpp:(.text._ZN2cv10ExrEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0xb6): undefined reference to `Imf::ChannelList::insert(char const*, Imf::Channel const&)'
grfmt_exr.cpp:(.text._ZN2cv10ExrEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0xbc): undefined reference to `Imf::globalThreadCount()'
grfmt_exr.cpp:(.text._ZN2cv10ExrEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0xd0): undefined reference to `Imf::OutputFile::OutputFile(char const*, Imf::Header const&, int)'
grfmt_exr.cpp:(.text._ZN2cv10ExrEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x12e): undefined reference to `Imf::Slice::Slice(Imf::PixelType, char*, unsigned int, unsigned int, int, int, double, bool, bool)'
grfmt_exr.cpp:(.text._ZN2cv10ExrEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x13a): undefined reference to `Imf::FrameBuffer::insert(char const*, Imf::Slice const&)'
grfmt_exr.cpp:(.text._ZN2cv10ExrEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x142): undefined reference to `Imf::OutputFile::setFrameBuffer(Imf::FrameBuffer const&)'
grfmt_exr.cpp:(.text._ZN2cv10ExrEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x19c): undefined reference to `Imf::OutputFile::writePixels(int)'
grfmt_exr.cpp:(.text._ZN2cv10ExrEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x21c): undefined reference to `half::convert(int)'
grfmt_exr.cpp:(.text._ZN2cv10ExrEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x282): undefined reference to `half::convert(int)'
grfmt_exr.cpp:(.text._ZN2cv10ExrEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x2e6): undefined reference to `Imf::OutputFile::~OutputFile()'
grfmt_exr.cpp:(.text._ZN2cv10ExrEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x2ec): undefined reference to `Imf::Header::~Header()'
grfmt_exr.cpp:(.text._ZN2cv10ExrEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x324): undefined reference to `half::_eLut'
grfmt_exr.cpp:(.text._ZN2cv10ExrEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x378): undefined reference to `Imf::Slice::Slice(Imf::PixelType, char*, unsigned int, unsigned int, int, int, double, bool, bool)'
grfmt_exr.cpp:(.text._ZN2cv10ExrEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x384): undefined reference to `Imf::FrameBuffer::insert(char const*, Imf::Slice const&)'
grfmt_exr.cpp:(.text._ZN2cv10ExrEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x3ae): undefined reference to `Imf::Slice::Slice(Imf::PixelType, char*, unsigned int, unsigned int, int, int, double, bool, bool)'
grfmt_exr.cpp:(.text._ZN2cv10ExrEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x3ba): undefined reference to `Imf::FrameBuffer::insert(char const*, Imf::Slice const&)'
grfmt_exr.cpp:(.text._ZN2cv10ExrEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x3e4): undefined reference to `Imf::Slice::Slice(Imf::PixelType, char*, unsigned int, unsigned int, int, int, double, bool, bool)'
grfmt_exr.cpp:(.text._ZN2cv10ExrEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x3f0): undefined reference to `Imf::FrameBuffer::insert(char const*, Imf::Slice const&)'
grfmt_exr.cpp:(.text._ZN2cv10ExrEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x40c): undefined reference to `Imf::OutputFile::writePixels(int)'
grfmt_exr.cpp:(.text._ZN2cv10ExrEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x436): undefined reference to `Imf::Header::channels()'
grfmt_exr.cpp:(.text._ZN2cv10ExrEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x44a): undefined reference to `Imf::Channel::Channel(Imf::PixelType, int, int, bool)'
grfmt_exr.cpp:(.text._ZN2cv10ExrEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x456): undefined reference to `Imf::ChannelList::insert(char const*, Imf::Channel const&)'
grfmt_exr.cpp:(.text._ZN2cv10ExrEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x45c): undefined reference to `Imf::Header::channels()'
grfmt_exr.cpp:(.text._ZN2cv10ExrEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x470): undefined reference to `Imf::Channel::Channel(Imf::PixelType, int, int, bool)'
grfmt_exr.cpp:(.text._ZN2cv10ExrEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x47c): undefined reference to `Imf::ChannelList::insert(char const*, Imf::Channel const&)'
grfmt_exr.cpp:(.text._ZN2cv10ExrEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x482): undefined reference to `Imf::Header::channels()'
grfmt_exr.cpp:(.text._ZN2cv10ExrEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x496): undefined reference to `Imf::Channel::Channel(Imf::PixelType, int, int, bool)'
grfmt_exr.cpp:(.text._ZN2cv10ExrEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x4a2): undefined reference to `Imf::ChannelList::insert(char const*, Imf::Channel const&)'
grfmt_exr.cpp:(.text._ZN2cv10ExrEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x4d2): undefined reference to `Imf::OutputFile::~OutputFile()'
grfmt_exr.cpp:(.text._ZN2cv10ExrEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x4d8): undefined reference to `Imf::Header::~Header()'
/home/jesus/opencv/build/lib/libopencv_highgui.a(grfmt_exr.cpp.o): In function `cv::ExrDecoder::readData(cv::Mat&)':
grfmt_exr.cpp:(.text._ZN2cv10ExrDecoder8readDataERNS_3MatE+0xec): undefined reference to `Imf::Slice::Slice(Imf::PixelType, char*, unsigned int, unsigned int, int, int, double, bool, bool)'
grfmt_exr.cpp:(.text._ZN2cv10ExrDecoder8readDataERNS_3MatE+0xf8): undefined reference to `Imf::FrameBuffer::insert(char const*, Imf::Slice const&)'
grfmt_exr.cpp:(.text._ZN2cv10ExrDecoder8readDataERNS_3MatE+0x14c): undefined reference to `Imf::Slice::Slice(Imf::PixelType, char*, unsigned int, unsigned int, int, int, double, bool, bool)'
grfmt_exr.cpp:(.text._ZN2cv10ExrDecoder8readDataERNS_3MatE+0x158): undefined reference to `Imf::FrameBuffer::insert(char const*, Imf::Slice const&)'
grfmt_exr.cpp:(.text._ZN2cv10ExrDecoder8readDataERNS_3MatE+0x1ae): undefined reference to `Imf::Slice::Slice(Imf::PixelType, char*, unsigned int, unsigned int, int, int, double, bool, bool)'
grfmt_exr.cpp:(.text._ZN2cv10ExrDecoder8readDataERNS_3MatE+0x1ba): undefined reference to `Imf::FrameBuffer::insert(char const*, Imf::Slice const&)'
grfmt_exr.cpp:(.text._ZN2cv10ExrDecoder8readDataERNS_3MatE+0x244): undefined reference to `Imf::Slice::Slice(Imf::PixelType, char*, unsigned int, unsigned int, int, int, double, bool, bool)'
grfmt_exr.cpp:(.text._ZN2cv10ExrDecoder8readDataERNS_3MatE+0x250): undefined reference to `Imf::FrameBuffer::insert(char const*, Imf::Slice const&)'
grfmt_exr.cpp:(.text._ZN2cv10ExrDecoder8readDataERNS_3MatE+0x2a0): undefined reference to `Imf::Slice::Slice(Imf::PixelType, char*, unsigned int, unsigned int, int, int, double, bool, bool)'
collect2: ld returned 1 exit status

我正在寻找一些我无法得到任何东西的东西。 有人可以帮忙吗? 非常感谢 即使我正在调查,我发现为了确保包含所有依赖项,我应该使用pkgconfig进行编译,如下所示:

arm-linux-g++ -o example IpCamPthread.cpp `pkg-config --static --cflags --libs opencv`

并且它创建了一个可执行文件,但当我制作&#34; file&#34;在可执行文件上这是结果:     示例:ELF 32位LSB可执行文件,ARM,版本1(SYSV),动态链接(使用共享库),用于GNU / Linux 2.6.26,未剥离 那么是一个ARM文件,但它是动态链接的,然后它在我的ARM中不起作用,我不明白为什么在我的&#34; opencv.pc&#34;中进行动态链接。文件有这个:

 # Package Information for pkg-config

 prefix=/home/jesus/opencv/build/install
 exec_prefix=${prefix}
 libdir=
 includedir_old=${prefix}/include/opencv
 includedir_new=${prefix}/include
  

名称:OpenCV       描述:开源计算机视觉库       版本:2.4.9       Libs:$ {exec_prefix} /lib/libopencv_contrib.a $ {exec_prefix} /lib/libopencv_stitching.a   $ {exec_prefix} /lib/libopencv_nonfree.a   $ {exec_prefix} /lib/libopencv_superres.a   $ {exec_prefix} /lib/libopencv_ocl.a $ {exec_prefix} /lib/libopencv_ts.a   $ {exec_prefix} /lib/libopencv_videostab.a   $ {exec_prefix} /lib/libopencv_gpu.a   $ {exec_prefix} /lib/libopencv_photo.a   $ {exec_prefix} /lib/libopencv_objdetect.a   $ {exec_prefix} /lib/libopencv_legacy.a   $ {exec_prefix} /lib/libopencv_video.a $ {exec_prefix} /lib/libopencv_ml.a   $ {exec_prefix} /lib/libopencv_calib3d.a   $ {exec_prefix} /lib/libopencv_features2d.a   $ {exec_prefix} /lib/libopencv_highgui.a   $ {exec_prefix} /share/OpenCV/3rdparty/lib/libIlmImf.a   $ {exec_prefix} /share/OpenCV/3rdparty/lib/liblibjasper.a   $ {exec_prefix} /share/OpenCV/3rdparty/lib/liblibtiff.a   $ {exec_prefix} /share/OpenCV/3rdparty/lib/liblibpng.a   $ {exec_prefix} /share/OpenCV/3rdparty/lib/liblibjpeg.a   $ {exec_prefix} /lib/libopencv_imgproc.a   $ {exec_prefix} /lib/libopencv_flann.a   $ {exec_prefix} /lib/libopencv_core.a   $ {exec_prefix} /share/OpenCV/3rdparty/lib/libzlib.a -lrt -lpthread -lm   -ldl -lstdc ++       Cflags:-I $ {includedir_old} -I $ {includedir_new}

所有使用open.pc的库都是静态的,所以我不知道为什么要编译和构建一个dinamic可执行文件。

有人??

2 个答案:

答案 0 :(得分:1)

向链接器遗漏一些-lSomeLib语句的经典案例。 似乎缺少pthread和gzip等等。要手动查找所需的库,请在“lib”文件夹中输入符号名称。

答案 1 :(得分:1)

大家好,感谢Idinev我一直在寻找如何添加库,以及如何确保我需要的每个库都是属性链接的。

所以我尝试使用pkgconfig我上面怎么说,但是我无法获得静态可执行文件,最后这是因为sintaxis错误。我用这个:

arm-linux-g ++ -static -o example IPCamera.cpp pkg-config --cflags --libs opencv

它有效,它创建了一个可执行文件,当我执行&#34;文件可执行文件&#34;输出是:

示例:ELF 32位LSB可执行文件,ARM,版本1(SYSV),静态链接,用于GNU / Linux 2.6.26,未剥离

静态链接!