Linking errors when compiling code with OpenCV Libraries

后端 未结 3 1806
耶瑟儿~
耶瑟儿~ 2020-12-14 19:46

I\'m trying to compile a sample program after installing Opencv with the command:

g++ hello-world.cpp -o hello-world -I /usr/local/include/opencv -L /usr/loc         


        
3条回答
  •  一个人的身影
    2020-12-14 20:28

    UPDATED-

    Better use this command:

    g++ opencv.cpp -o opencv -L `pkg-config --cflags --libs opencv`
    

    The pkg-config command will locate the correct include and library for your source code.
    For better handling with OpenCV programming go with an IDE like code::block.

    Maybe this tutorial will help you in OpenCV programming with code::block:
    How to Setup OpenCV for code :: block in Linux and Windows?

提交回复
热议问题