使用Qt + opencv + ffmpeg时,Mac上的架构x86_64找不到符号

时间:2022-03-25 02:45:03

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.

我正在Mac上使用Qt + opencv + ffmpeg运行一个项目,但它出现了一个错误:找不到架构x86_64的符号。


Part of .pro:

.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

当我使用GCC(/ usr / bin中的x86 64位)进行编译时,它会显示出来

error: symbol(s) not found for architecture x86_64

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

当我使用Clang(/ usr / bin中的x86 64位)进行编译时,它会显示出来

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?

我正在使用OS X Yosemite 10.10.4。有人知道如何解决它吗?

1 个解决方案

#1


0  

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

您已将INCLUDEPATH的路径包含在内,而不是LIBS中的库本身

Maybe this or this answer helps you:

也许这个或这个答案可以帮助你:

#1


0  

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

您已将INCLUDEPATH的路径包含在内,而不是LIBS中的库本身

Maybe this or this answer helps you:

也许这个或这个答案可以帮助你: