问题
qt项目下的pro文件中配置lib和include的目录, 也用了extern防止编译问题 但是还是出现了未定义报错。
pro文件
LIBS += -L$$PWD/ffmpeg-4.2.2-win64-dev/lib/ -lavcodec -lavdevice -lavfilter -lavformat -lavutil -lpostproc -lswscale -lswresample
FORMS += trackTool/mainwindow.ui
INCLUDEPATH += $$PWD/ffmpeg-4.2.2-win64-dev/include \
$$PWD/rtsp \
$$PWD/ptz \
$$PWD/tool \
$$PWD/src
头文件
extern "C"
{
#include "libavcodec/avcodec.h"
#include "libavformat/avformat.h"
#include "libavutil/pixfmt.h"
#include "libswscale/swscale.h"
}
报错信息:
问题原因
QT使用的构建套件是32位的,引用的ffmepg库是64位的,位数不兼容导致没有找到定义。