【问题标题】:how to use x264 dll in another project如何在另一个项目中使用 x264 dll
【发布时间】:2014-09-28 03:51:57
【问题描述】:

在此处输入代码 我想在我的项目中使用 x264。代码中有一行说:

/* Application developers planning to link against a shared library version of * libx264 from a Microsoft Visual Studio or similar development environment * will need to define X264_API_IMPORTS before including this header. * This clause does not apply to MinGW, similar development environments, or non * Windows platforms. */

但我不明白这一行: 在包含此标头之前定义 X264_API_IMPORTS

我们可以通过其配置创建x264 dll并制作

    ./configure --enable-shared
    make

但我不能在我的 Qt 项目中使用 dll。

我可以制作自己的 dll(在另一个代码中)并在项目中使用它。 但是当我开始在我的项目中使用 x264 dll 时,我收到以下错误:

    C:\DataHiding\SourceCode2\GUI\DataHiding\mainwindow.cpp:10: error:
    'pulldown_frame_duration' was not declared in this scope
    qDebug() << pulldown_frame_duration[1];
             ^

【问题讨论】:

    标签: qt dll makefile x264 libx264


    【解决方案1】:

    "define X264_API_IMPORTS before include this header" 意味着你应该把这一行:

    #define X264_API_IMPORTS
    

    就在这一行之前:

    #include <x264.h>
    

    【讨论】:

    • 感谢您的回复,但将此行添加到我的代码中没有帮助,我仍然收到相同的错误:error: undefined reference to x264_encoder_test(int)
    • @user3604079 您的两个错误都与 libx264 无关。 libx264 中没有 pulldown_frame_duration 或 x264_encoder_test 符号,因此所有这些引用(错误)都在 您的调用代码中。
    • @legoscia 想象一下,我想将自己的函数添加到 dll 中,然后再次制作 dll。我尝试了 x264 函数,我得到了同样的错误。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-23
    • 1970-01-01
    相关资源
    最近更新 更多