Setting up OpenCV in QT on OSX

后端 未结 3 764
清歌不尽
清歌不尽 2020-12-28 23:23

I am trying to set up OpenCV to work with QT on OSX 10.7.5/MacbookPro 2.5 Ghz Intel Core 2 Duo. I\'ve seen a few related question here (How to link

3条回答
  •  佛祖请我去吃肉
    2020-12-29 00:08

    You are facing 2 potential issues here:

    1. first one is, on Mac platforms, depending on the compiler (clang or gcc) you will not link against the same stdc++ library (I ran into this issue while trying to get some static opencv lib working with an iOS project). However, it does not seem to be the case here since you do not have C++ errors, but it's worth checking what compiler you use in each case;
    2. second one, QtCreator is a graphical app. Thus it is not aware of your terminal-session settings. This includes the path to dynamic libraries in /usr/local. You can avoid this by different approaches: using a static opencv lib, using install_tool to change the path to the library coded in the output binary, or by using the preferences of QtCreator to set the DYLD_LIBRARY_PATH variable to something like /usr/local/lib when it runs your program.

提交回复
热议问题