0

I'm running a project using Qt+opencv+ffmpeg on Mac, but it comes to an error: symbol(s) not found for architecture x86_64.


Part of .pro:

INCLUDEPATH += /usr/local/include
INCLUDEPATH += /usr/local/include/opencv
INCLUDEPATH += /usr/local/include/opencv2

LIBS += -L/usr/local/lib -lavformat -lavcodec -lavutil

When I use GCC (x86 64bit in /usr/bin) to compile, it shows

error: symbol(s) not found for architecture x86_64

When I use Clang (x86 64bit in /usr/bin) to compile, it shows

error: symbol(s) not found for architecture x86_64
error: linker command failed with exit code 1 (use -v to see invocation)

I'm using OS X Yosemite 10.10.4. Does anybody know how to fix it?

Galaxy
  • 853
  • 2
  • 11
  • 28
  • 1
    You have to add necessary `opencv` libraries to your `LIBS` flags. – baf Jul 20 '15 at 08:29
  • Can you include the list of symbols that weren't found? For ffmpeg linking flags, use "pkgconfig --libs libavformat libavcodec libavutil", not -lavcodec -lavformat -lavutil. – Ronald S. Bultje Jul 20 '15 at 11:35

1 Answers1

0

You have included the path with INCLUDEPATHbut not the library itselfs with LIBS

Maybe this or this answer helps you:

Community
  • 1
  • 1
Megasa3
  • 766
  • 10
  • 25