apachezero
apachezero

Reputation: 1

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;
}

Upvotes: 0

Views: 240

Answers (2)

apachezero
apachezero

Reputation: 1

Well, thanks to john above, I'v solved this problem. Go your project properties and change platform to the x64, then re-configure all build you did before,then it works.

Upvotes: 0

SparkyPotato
SparkyPotato

Reputation: 468

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.

Upvotes: 1

Related Questions