Welcome to MLink Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
252 views
in Technique[技术] by (71.8m points)

c++ - failed to build ffmpeg in vs2019 but can't know why

I want to add my ffmpeg to the vs2019(community edition),and here's my step.

  1. create an empty c++ program. 2.go to "ffmpeg-shared file" and copy Folder "include" and "lib" to the root of my c++ program. 3.copy 8 files of the bin folder to the root of my c++ program. 4.In vs2019, i added "include" to the additional include directories, also did same thing to lib in linker and add all 8 dll files in the "Linker/input". so i wrote a simple program to verify whether it success,but it said that"unresolved external symbol _avcodec_configuration referenced in function _main". please help.my test code like this:
#define __STDC_CONSTANT_MACROS

extern "C" {
#include "libavcodec/avcodec.h"
}

int main() {
    
    printf("%s", avcodec_configuration());
    return 0;
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You have to link with the export .lib files. Each ffmpeg DLL should have a corresponding .lib file, which is what should actually go into the linker options. You then have to make sure the DLLs are in the same folder as the output .exe binary.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to MLink Developer Q&A Community for programmer and developer-Open, Learning and Share
...