使用除avformat外的所以库都不能连接动态链接库 #include "QtGuiApplication1.h" #include <QtWidgets/QApplication> #include <QDebug.h> #pragma comment(lib,"avformat.lib") #pragma comment(lib,"avutil.lib") #pragma comment(lib,"avcodec.lib") extern "C" { #include <libavformat\avformat.h> #include <libavutil\avutil.h> #include <libavcodec\avcodec.h> } int main(int argc, char *argv[]) { av_register_all(); qDebug() <<"av_register_all is finished\n"; char *path = "test.mp4"; AVFormatContext *ic=NULL; int re =avformat_open_input(&ic,path,0,0); if (re != 0) { //char errbuf[1024] = {0}; //av_strerror(re, errbuf, sizeof(errbuf)); printf("open failed"); getchar(); return -1; } int timebase = ic->duration /AV_TIME_BASE; qDebug() << timebase / 60<< "minutil" << timebase % 60 << "sec"<< "\n"; AVPacket pkt; re=av_read_frame(ic, &pkt); av_packet_unref(&pkt); avformat_close_input(&ic); QApplication a(argc, argv); QtGuiApplication1 w; w.show(); return a.exec(); } 提示:
无法定位程序输入点av_packet_unref于动态链接库
G:\Visual_Studio\QtGuiApplication\x64\Debug\QGuiApplication1.exe
|