Ubuntu2004编译VLC-QT(记录)(根据官方步骤来)

来到VLC-QT的github官方地址--VLC-QT(点击前面的)

下载官方源码,也可以git clone拉取

2:解压源码之后,进入文件夹

创建文件夹“build”用于存放待会编译产生的相关文件,执行

mkdir build
cd build

 回到VLC-QT官方的github地址,往下拉,找到“Building and requirement”,点击进入,如图:

然后再新界面继续找到自己的系统,如图:我的是linux

 因为我们前面已经创建build文件夹并进入,所以我们直接执行:(这些操作都是在build目录中完成)

cmake .. -DCMAKE_BUILD_TYPE=Debug
make -j8
make install

完成后,build目录下,会多出许多文件:

其中:build目录下的src文件中的这三个里面的.SO文件(刚刚好每个都是三个.so文件,一共9个),移植到自己的Qt项目中,即可使用了

报错1:

        CMake Error at config/Dependencies.cmake:29 (FIND_PACKAGE): By not providing "FindQt5Quick.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Qt5Quick", but CMake did not find one.

         Could not find a package configuration file provided by "Qt5Quick" (requested version 5.2.0) with any of the following names:

        Qt5QuickConfig.cmake

        qt5quick-config.cmake

        Add the installation prefix of "Qt5Quick" to CMAKE_PREFIX_PATH or set "Qt5Quick_DIR" to a directory containing one of the above files. If "Qt5Quick" provides a separate development package or SDK, be sure it has been installed.

   Call Stack (most recent call first):

        CMakeLists.txt:50 (INCLUDE)

则执行即可: (报错原因为:编译过程中,无法找到相关的Qt5Quick 的开发包)(下面命令是安装Qt5Quick的相关包)(注意执行完,安装好之后,重新执行“cmake .. -DCMAKE_BUILD_TYPE=Debug”)

sudo apt-get install qtdeclarative5-dev

报错2: 

CMake Error at config/Dependencies.cmake:28 (FIND_PACKAGE):
  By not providing "FindQt5Core.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Qt5Core", but
  CMake did not find one.

  Could not find a package configuration file provided by "Qt5Core"
  (requested version 5.2.0) with any of the following names:

    Qt5CoreConfig.cmake
    qt5core-config.cmake

  Add the installation prefix of "Qt5Core" to CMAKE_PREFIX_PATH or set
  "Qt5Core_DIR" to a directory containing one of the above files.  If
  "Qt5Core" provides a separate development package or SDK, be sure it has
  been installed.
Call Stack (most recent call first):

  CMakeLists.txt:51 (INCLUDE)

-- Configuring incomplete, errors occurred

报错原因:编译过程无法找到相关的Qt5

1:确保已经安装了 Qt5。如果没有就安装:

 sudo apt-get install qt5-default qtbase5-dev

   2:如果确保正确安装了Qt5,则设置 CMake 的路径:
        找到 Qt5 的安装路径,并将其添加到 CMAKE_PREFIX_PATH 或设置 Qt5Core_DIR。
        示例

cmake -DCMAKE_PREFIX_PATH=/qt5 ..(Qt5的安装路径)

或者:

cmake -DQt5Core_DIR=/path/to/qt5/lib/cmake/Qt5Core ..


确保 CMakeLists.txt 文件中包含了正确的 Qt5 查找指令:

find_package(Qt5Core 5.2 REQUIRED)

其他报错我还没遇到,如有其他情况,欢迎截图放在评论区下方,我如果看到会第一时间回复。

  • 25
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

不会创建对象

谢谢考官。

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值