我正在尝试在Ubuntu机器上编译VLC。因此,在获得构建所需的所有其他软件包后,当我运行./configure
时,它说找不到Qt5Core以及其他一些与Qt相关的库。问题是我知道Qt5的完整安装及其库在我的系统上的主目录而不是全局目录中可用。构建时,pkg-config 似乎不检查主目录。如何将Qt5安装的实际位置通知构建系统?
注意:我尝试从适当的来源下载Qt,但该安装是针对Qt5.9而不是所需的Qt5.11。
configure
需要查找Qt模块的.pc
文件,
如果你检查config.log
,它可能会抱怨:
configure:xxxx: $PKG_CONFIG --exists --print-errors "Qt5Core >= 5.11.0 Qt5Widgets Qt5Gui Qt5Quick Qt5QuickWidgets Qt5QuickControls2 Qt5Svg"
Package Qt5Quick was not found in the pkg-config search path.
Perhaps you should add the directory containing `Qt5Quick.pc'
to the PKG_CONFIG_PATH environment variable
No package 'Qt5Quick' found
Package Qt5QuickWidgets was not found in the pkg-config search path.
Perhaps you should add the directory containing `Qt5QuickWidgets.pc'
to the PKG_CONFIG_PATH environment variable
在那里,要configure
链接到特定的Qt安装,您有几个选择 , 导出变量QT_LIBS
export QT_LIBS=/path/to/qt/libs/
或者,直接将包含.pc
文件的Qtpkgconfig
路径添加到shellPKG_CONFIG_PATH
,
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/path/to/qt/libs/pkgconfig/