0

I am trying to write a program using FFMPEG libraries. I read about in this link. I downloaded Shared and Devs files from http://ffmpeg.zeranoe.com/builds/.

I created a console project and this is the configuration:

Additional Libraries Directories enter image description here

Additional Include Directories enter image description here

And here is my code:

#include "stdafx.h"
#pragma comment (lib, "avformat.lib")
#pragma comment (lib, "avcodec.lib")
#pragma comment (lib, "avutil.lib")

extern "C"
{
    #ifndef __STDC_CONSTANT_MACROS
    #define __STDC_CONSTANT_MACROS
    #endif
    #include <libavcodec\avcodec.h>
    #include <libavformat\avformat.h>
    #include <libswscale\swscale.h>
    #include <libavutil\avutil.h>
}
int _tmain(int argc, _TCHAR* argv[])
{
    av_register_all();
    return 0;
}

And the error I am getting is this:

Error 1 error LNK2019: unresolved external symbol _av_register_all referenced in function _wmain C:\Users\Andres\Documents\Visual Studio 2013\Projects\PruebaFFMPEG\PruebaFFMPEG\PruebaFFMPEG.obj PruebaFFMPEG

Error 2 error LNK1120: 1 unresolved externals C:\Users\Andres\Documents\Visual Studio 2013\Projects\PruebaFFMPEG\Debug\PruebaFFMPEG.exe PruebaFFMPEG

What am I missing?

1 Answer 1

1

It seems that you are trying to link a 32-bit application with 64-bit libraries. Download 32-bit libraries from http://ffmpeg.zeranoe.com/builds/ or create x64 configuration for your solution.

2
  • I downloaded 64bit version because I have a 64bit Windows, will 32bit work? How is x64 configuration?
    – Andres
    Commented Dec 19, 2013 at 14:29
  • Open Project properties -> click Configuration Manager... -> Active Solution Platform -> New.. -> Select x64 (see screenshot goo.gl/54ND5t)
    – pogorskiy
    Commented Dec 19, 2013 at 16:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.