zoukankan      html  css  js  c++  java
  • pkg-config

    wiki

    pkg-config.org

    其它参考链接

    事情是这样子的

    编译opencv下的sample/cpp文件夹下的stitching.cpp文件

    g++ `pkg-config --cflags --libs opencv` --std=c++11 stitching.cpp

    提示未定义的引用

    g++ -std=c++11 stitching.cpp -L /usr/local/lib/*.so

    改用上述编译命令成功编译

    /usr/local/lib/pckconfig/opencv.hc内容如下

    # Package Information for pkg-config
    
    prefix=/usr/local
    exec_prefix=${prefix}
    libdir=${exec_prefix}/lib
    includedir_old=${prefix}/include/opencv
    includedir_new=${prefix}/include
    
    Name: OpenCV
    Description: Open Source Computer Vision Library
    Version: 3.3.0
    Libs: -L${exec_prefix}/lib -lopencv_cudabgsegm -lopencv_cudaobjdetect -lopencv_cudastereo -lopencv_dnn -lopencv_ml -lopencv_shape -lopencv_stitching -lopencv_cudafeatures2d -lopencv_superres -lopencv_cudacodec -lopencv_videostab -lopencv_cudaoptflow -lopencv_cudalegacy -lopencv_calib3d -lopencv_features2d -lopencv_highgui -lopencv_videoio -lopencv_photo -lopencv_imgcodecs -lopencv_cudawarping -lopencv_cudaimgproc -lopencv_cudafilters -lopencv_video -lopencv_objdetect -lopencv_imgproc -lopencv_flann -lopencv_cudaarithm -lopencv_core -lopencv_cudev
    Libs.private: -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype -lgthread-2.0 -L/usr/lib/x86_64-linux-gnu -lpng -lz -ltiff -ljasper -ljpeg -ldc1394 -lavcodec-ffmpeg -lavformat-ffmpeg -lavutil-ffmpeg -lswscale-ffmpeg -ldl -lm -lpthread -lrt -lcudart -lnppc -lnppi -lnpps -lcufft -L-L/usr/local/cuda-8.0 -l64
    Cflags: -I${includedir_old} -I${includedir_new}

    原因应该是opencv.hc链接库没写全

  • 相关阅读:
    Markdown引用图片,且不使用网上链接的解决方法
    测试
    sudo用户权限添加问题
    windows安装ipython
    ansible基本操作
    mysql用户权限操作
    解决windows7系统的快捷方式无法添加到任务栏
    linux下查看磁盘分区的文件系统格式
    mail客户端POP和IMAP协议
    linux设置history历史记录
  • 原文地址:https://www.cnblogs.com/dirge/p/8232747.html
Copyright © 2011-2022 走看看