[x264-devel] Link error question

Steven Walters kemuri9 at gmail.com
Sat Apr 17 17:54:10 CEST 2010


you're dealing with C++ and x264.h is only C compliant.
if you want to use x264.h within C++ code, you'll need to wrap it
within extern "C"
e.g.

#include <inttypes.h>
extern "C" {
#include "x264.h"
}
#include <iostream>

using namespace std;

int main()
{
    cout << "test libx264" << endl;

    x264_param_t param;
    x264_param_default(&param);
    x264_t *x264 = x264_encoder_open(&param);

    return 0;
}

On Sat, Apr 17, 2010 at 10:57 AM, Vinicius Heineck <heineck at gmail.com> wrote:
> I'm a user beginner of the libx264, and when I compile a test code with only
> one function, I receive a link error.
> I read the x264.h, but not understand because exists this error, because the
> libx264.lib is find in my code.
> Perhaps the error exists because an VERSION incompatibility, I'm using
> UBUNTU 9.10 with g++ 4.4.1.
> How I compile the source whitout any bugs?
>
> Source code:
>
> #include "inttypes.h"
> #include "stdint.h"
> #include "x264.h"
>
> using namespace std;
>
> int main()
> {
>     cout << "test libx264" << endl;
>
>     x264_t *x264;
>     x264_param_t *param;
>     x264 = x264_encoder_open(param);
>
>     return 0;
> }
>
>
> Thanks!
> Vinícius
>
>
>
> _______________________________________________
> x264-devel mailing list
> x264-devel at videolan.org
> http://mailman.videolan.org/listinfo/x264-devel
>
>


More information about the x264-devel mailing list