symbol(s) not found for architecture x86_64 on Mac

2019-09-12 09:02发布

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?

1条回答
虎瘦雄心在
2楼-- · 2019-09-12 09:46

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

Maybe this or this answer helps you:

查看更多
登录 后发表回答