pkg-config是一种计算机软件,它提供了一个统一的界面,用于查询已安装的库,以便从源代码编译软件。
我正在尝试从 Giraffe Library 网站编译 GTK 3 Hello World 示例。 我从源安装了 Poly/ML 5.9.1,为 Poly 可执行文件设置了 PATH,为库设置了 LD_LIBRARY_PATH...
我正在使用我的工具链为 ARM 编译 gst-plugins-bad。我编译了构建它所需的所有内容,包括 gstreamer、libmms 等...并将两个标头放入我的 sysroot 中,
pkg-config 在 Ubuntu 24.04 上找不到足够的 gobject-introspection-1.0 依赖项
我的介子构建失败了: 称为:`/usr/bin/pkg-config --modversion gobject-introspection-1.0` -> 1 标准错误: 无法满足包依赖性要求“glib-2.0 >= 2.80.0”...
`dnf install 'pkgconfig(NAME)'`语法究竟是如何工作的?
Fedora 打包指南(永久链接)正式建议在声明构建依赖项时使用 pkgconfig(NAME) 语法。例如,您可以选择...
我正在用 Rust 编写一个 TLS 库,但我将其设为 C 动态库。为了测试它,我正在用 C 语言开发一个简单的 HTTPS 客户端。我必须将 turtls(我的 TLS 库)动态链接到我的 HTTPS c...
如何安装 FFmpeg 以便 pkg-config 可以找到它?
我想在我的程序中使用 ffmpeg 库。它们是 libavformat 和 libavcodec。为了链接它们,我尝试使用 pkg-config。 我无法让 pkg-config 找到这些库。 当我跑步时 pkg-...
Windows 11 上的 CMake pkg-config 返回错误:“‘virtual:world’需要,未找到”
我正准备在Windows 11上编译GTK+-3.0测试应用程序。我有一个在Linux上运行良好的CMake配置。 我已经按照以下说明安装了 GTK 3.0 和 msys2:https://www....
我正在构建一个在 Wolfi OS 上使用 libudev 开发标头的项目(cgr.dev/chainguard/rust:latest-dev)。我知道在基于 Debian 的发行版上所需的软件包是 libudev-dev,但没有这样的
无法在 macOS 上构建 pkgconfig:整数到指针转换不兼容
我正在尝试使用 clang 在 macOS 上构建 pkgconfig 0.29。我收到这些错误: gatomic.c:392:10:错误:不兼容的整数到指针转换将“gssize”(又名“long”)传递给“
使用 CMake 和 pkg-config 正确配置、生成和构建一个包含系统库的简单项目的步骤?
我在编写C/C++代码方面有一些旧的经验,但现在我想学习如何在现代环境中构建应用程序,并链接一些系统库。 我正在构建我的代码只是使用...
在 Windows 上构建 portaudio golang 包装器
我正在尝试使用 github.com/gordonklaus/portaudio 库。该库需要 portaudio 作为安装程序。我已经构建了实际 C portaudio 库的 64 位 dll,作为 go 包的要求...
尝试使用 CMake 构建时,PkgConfig 找不到“glib-2.0”
我正在尝试使用 CMake 编译一个用 C++ 编写的程序。 代码附带的 CMakeLists.txt 文件的内容是: cmake_minimum_required(版本3.21) 项目( 我正在尝试使用 CMake 编译一个用 C++ 编写的程序。 代码附带的 CMakeLists.txt 文件的内容是: cmake_minimum_required(VERSION 3.21) project(<redacted> C CXX) set(CMAKE_CXX_STANDARD 23) add_executable(<redacted> src/main.cpp src/<redacted>.h src/<redacted>.h src/<redacted>.cpp src/<redacted>.h src/<redacted>.h src/<redacted>.cpp src/<redacted>.h src/<redacted>.cpp src/<redacted>.h src/<redacted>.h src/<redacted>.c src/<redacted>.h) find_package(PkgConfig REQUIRED) pkg_search_module(GLIB REQUIRED glib-2.0) include_directories(${GLIB_INCLUDE_DIRS}) link_directories(${GLIB_LIBRARY_DIRS}) target_link_libraries(<redacted> ${GLIB_LIBRARIES} gcrypt) 当我在 w64devkit(或 Visual Studio 或 VSCode)中运行命令:cmake . -G "MinGW Makefiles" && make时,出现以下错误: -- Found PkgConfig: C:/Users/Jonathon/Downloads/pkg-config-lite-0.28-1_bin-win32/pkg-config-lite-0.28-1/bin/pkg-config.exe (found version "0.28") -- Checking for module 'glib-2.0' -- No package 'glib-2.0' found CMake Error at C:/Program Files/CMake/share/cmake-3.29/Modules/FindPkgConfig.cmake:634 (message): The following required packages were not found: - glib-2.0 Call Stack (most recent call first): C:/Program Files/CMake/share/cmake-3.29/Modules/FindPkgConfig.cmake:862 (_pkg_check_modules_internal) CMakeLists.txt:28 (PKG_CHECK_MODULES) -- Configuring incomplete, errors occurred! 有一个类似的帖子here,但那是在Linux上,而我在Windows上。另外,找到的解决方案是从 CMakeLists.txt 中删除一行,但该行不存在于我的 CMakeLists.txt 文件中。 任何帮助将不胜感激。谢谢 [更新] 我尝试使用 conan 安装 glib,并将其用作 conanfile.txt: [requires] glib/2.78.3 [generators] CMakeDeps CMakeToolchain 然后,当我输入命令 conan install . --output-folder=build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake && cmake --build (按照建议 here 因为我在使用 conan install . --output-folder=build && cmake --build 时收到“错误:找不到 Conanfile”),这是我得到的输出: ======== Input profiles ======== Profile host: [settings] arch=x86_64 build_type=Release compiler=msvc compiler.cppstd=14 compiler.runtime=dynamic compiler.runtime_type=Release compiler.version=193 os=Windows Profile build: [settings] arch=x86_64 build_type=Release compiler=msvc compiler.cppstd=14 compiler.runtime=dynamic compiler.runtime_type=Release compiler.version=193 os=Windows ======== Computing dependency graph ======== Graph root conanfile.txt: C:\Users\Jonathon\source\tlsdump-main\tlsdump-main\conanfile.txt Requirements bzip2/1.0.8#457c272f7da34cb9c67456dd217d36c4 - Cache glib/2.78.3#0cd1865c8603d90b3bc5858065e16d01 - Cache libffi/3.4.4#35eb63842b505824b70aedc1baefc916 - Cache libgettext/0.22#2c87563d7a69544dd9379f038aca3b0b - Cache libiconv/1.17#73fefc1b696e069df90fd1d18aa63edd - Cache pcre2/10.42#a7a2c122056510509a7525c83d6a6695 - Cache zlib/1.3.1#f52e03ae3d251dec704634230cd806a2 - Cache Build requirements autoconf/2.71#f9307992909d7fb3df459340f1932809 - Cache automake/1.16.5#058bda3e21c36c9aa8425daf3c1faf50 - Cache m4/1.4.19#b38ced39a01e31fef5435bc634461fd2 - Cache meson/1.2.2#04bdfb85d665c82b08a3510aee3ffd19 - Cache msys2/cci.latest#5a31efa2bde593541fd5ac3bcc50c01c - Cache ninja/1.11.1#77587f8c8318662ac8e5a7867eb4be21 - Cache pkgconf/2.0.3#f996677e96e61e6552d85e83756c328b - Cache Resolved version ranges zlib/[>=1.2.11 <2]: zlib/1.3.1 ======== Computing necessary packages ======== Requirements bzip2/1.0.8#457c272f7da34cb9c67456dd217d36c4:67bfcb7b4b78262b9d05495e479dcd92f747316b#cea9c0f0dfa41e83aebd5d39c5a5cbf3 - Cache glib/2.78.3#0cd1865c8603d90b3bc5858065e16d01:750e9c8cf560085c96c0fa42531c45c18af8be50#29d02404508c39a0803c3bee40426924 - Cache libffi/3.4.4#35eb63842b505824b70aedc1baefc916:7bfde258ff4f62f75668d0896dbddedaa7480a0f#37e6c892e9418389fcf21227e9c1ae6b - Cache libgettext/0.22#2c87563d7a69544dd9379f038aca3b0b:55052839d1d508208c0cd4c7594a7001c70287d1#bea6a5629dc31a80b4d489e5ef163ec4 - Cache libiconv/1.17#73fefc1b696e069df90fd1d18aa63edd:7bfde258ff4f62f75668d0896dbddedaa7480a0f#9ef92719f5c05dca2f0dbb46f50d3f8d - Cache pcre2/10.42#a7a2c122056510509a7525c83d6a6695:1bbffc30d8479a890917ef6674ab5e5f3c5b2036#d6a7c0162d1450645a9d56832ca25ae6 - Cache zlib/1.3.1#f52e03ae3d251dec704634230cd806a2:7bfde258ff4f62f75668d0896dbddedaa7480a0f#20d10b761ec15eed7a1d61c86bc7415a - Cache Build requirements Skipped binaries autoconf/2.71, automake/1.16.5, m4/1.4.19, meson/1.2.2, msys2/cci.latest, ninja/1.11.1, pkgconf/2.0.3 ======== Installing packages ======== bzip2/1.0.8: Already installed! (1 of 7) zlib/1.3.1: Already installed! (2 of 7) libiconv/1.17: Already installed! (3 of 7) libffi/3.4.4: Already installed! (4 of 7) pcre2/10.42: Already installed! (5 of 7) pcre2/10.42: Appending PATH environment variable: C:\Users\Jonathon\.conan2\p\pcre2e09694aa47719\p\bin libgettext/0.22: Already installed! (6 of 7) glib/2.78.3: Already installed! (7 of 7) WARN: deprecated: Usage of deprecated Conan 1.X features that will be removed in Conan 2.X: WARN: deprecated: 'cpp_info.names' used in: zlib/1.3.1, bzip2/1.0.8, pcre2/10.42, libiconv/1.17, libgettext/0.22 WARN: deprecated: 'cpp_info.build_modules' used in: bzip2/1.0.8 WARN: deprecated: 'env_info' used in: pcre2/10.42, libiconv/1.17, bzip2/1.0.8, glib/2.78.3 ======== Finalizing install (deploy, generators) ======== conanfile.txt: Writing generators to C:\Users\Jonathon\source\tlsdump-main\tlsdump-main\build conanfile.txt: Generator 'CMakeDeps' calling 'generate()' conanfile.txt: CMakeDeps necessary find_package() and targets for your CMakeLists.txt find_package(glib) target_link_libraries(... glib::glib) conanfile.txt: Generator 'CMakeToolchain' calling 'generate()' conanfile.txt: CMakeToolchain generated: conan_toolchain.cmake conanfile.txt: Preset 'conan-default' added to CMakePresets.json. Invoke it manually using 'cmake --preset conan-default' if using CMake>=3.23 conanfile.txt: If your CMake version is not compatible with CMakePresets (<3.23) call cmake like: 'cmake <path> -G "Visual Studio 17 2022" -DCMAKE_TOOLCHAIN_FILE=C:\Users\Jonathon\source\tlsdump-main\tlsdump-main\build\conan_toolchain.cmake -DCMAKE_POLICY_DEFAULT_CMP0091=NEW' conanfile.txt: CMakeToolchain generated: CMakePresets.json conanfile.txt: CMakeToolchain generated: ..\CMakeUserPresets.json conanfile.txt: Generating aggregated env files conanfile.txt: Generated aggregated env files: ['conanbuild.bat', 'conanrun.bat'] Install finished successfully -- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.19045. -- Checking for one of the modules 'glib-2.0' CMake Error at C:/Program Files/CMake/share/cmake-3.29/Modules/FindPkgConfig.cmake:927 (message): None of the required 'glib-2.0' found Call Stack (most recent call first): CMakeLists.txt:20 (pkg_search_module) -- Configuring incomplete, errors occurred! 现在,glib 版本 2.78.3 已安装,因为这是 conan 提供的最新版本。 conan 提供的最早版本是 2.65.0,因此当我尝试更改 conanfile 以尝试获取版本 2.0.0 时,它不起作用。另外,版本 2.0.0 是 2002 年的版本,我非常怀疑我正在尝试编译的项目正在使用它,因为它是去年制作的。 当我返回 CMakeLists.txt 文件并更改此行时: pkg_search_module(GLIB REQUIRED glib-2.0) 到 pkg_search_module(GLIB REQUIRED glib-2.78.3),然后再次运行 conan install . --output-folder=build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake && cmake --build 命令,我得到以下输出:======== Input profiles ======== Profile host: [settings] arch=x86_64 build_type=Release compiler=msvc compiler.cppstd=14 compiler.runtime=dynamic compiler.runtime_type=Release compiler.version=193 os=Windows Profile build: [settings] arch=x86_64 build_type=Release compiler=msvc compiler.cppstd=14 compiler.runtime=dynamic compiler.runtime_type=Release compiler.version=193 os=Windows ======== Computing dependency graph ======== Graph root conanfile.txt: C:\Users\Jonathon\source\tlsdump-main\tlsdump-main\conanfile.txt Requirements bzip2/1.0.8#457c272f7da34cb9c67456dd217d36c4 - Cache glib/2.78.3#0cd1865c8603d90b3bc5858065e16d01 - Cache libffi/3.4.4#35eb63842b505824b70aedc1baefc916 - Cache libgettext/0.22#2c87563d7a69544dd9379f038aca3b0b - Cache libiconv/1.17#73fefc1b696e069df90fd1d18aa63edd - Cache pcre2/10.42#a7a2c122056510509a7525c83d6a6695 - Cache zlib/1.3.1#f52e03ae3d251dec704634230cd806a2 - Cache Build requirements autoconf/2.71#f9307992909d7fb3df459340f1932809 - Cache automake/1.16.5#058bda3e21c36c9aa8425daf3c1faf50 - Cache m4/1.4.19#b38ced39a01e31fef5435bc634461fd2 - Cache meson/1.2.2#04bdfb85d665c82b08a3510aee3ffd19 - Cache msys2/cci.latest#5a31efa2bde593541fd5ac3bcc50c01c - Cache ninja/1.11.1#77587f8c8318662ac8e5a7867eb4be21 - Cache pkgconf/2.0.3#f996677e96e61e6552d85e83756c328b - Cache Resolved version ranges zlib/[>=1.2.11 <2]: zlib/1.3.1 ======== Computing necessary packages ======== Requirements bzip2/1.0.8#457c272f7da34cb9c67456dd217d36c4:67bfcb7b4b78262b9d05495e479dcd92f747316b#cea9c0f0dfa41e83aebd5d39c5a5cbf3 - Cache glib/2.78.3#0cd1865c8603d90b3bc5858065e16d01:750e9c8cf560085c96c0fa42531c45c18af8be50#29d02404508c39a0803c3bee40426924 - Cache libffi/3.4.4#35eb63842b505824b70aedc1baefc916:7bfde258ff4f62f75668d0896dbddedaa7480a0f#37e6c892e9418389fcf21227e9c1ae6b - Cache libgettext/0.22#2c87563d7a69544dd9379f038aca3b0b:55052839d1d508208c0cd4c7594a7001c70287d1#bea6a5629dc31a80b4d489e5ef163ec4 - Cache libiconv/1.17#73fefc1b696e069df90fd1d18aa63edd:7bfde258ff4f62f75668d0896dbddedaa7480a0f#9ef92719f5c05dca2f0dbb46f50d3f8d - Cache pcre2/10.42#a7a2c122056510509a7525c83d6a6695:1bbffc30d8479a890917ef6674ab5e5f3c5b2036#d6a7c0162d1450645a9d56832ca25ae6 - Cache zlib/1.3.1#f52e03ae3d251dec704634230cd806a2:7bfde258ff4f62f75668d0896dbddedaa7480a0f#20d10b761ec15eed7a1d61c86bc7415a - Cache Build requirements Skipped binaries autoconf/2.71, automake/1.16.5, m4/1.4.19, meson/1.2.2, msys2/cci.latest, ninja/1.11.1, pkgconf/2.0.3 ======== Installing packages ======== bzip2/1.0.8: Already installed! (1 of 7) zlib/1.3.1: Already installed! (2 of 7) libiconv/1.17: Already installed! (3 of 7) libffi/3.4.4: Already installed! (4 of 7) pcre2/10.42: Already installed! (5 of 7) pcre2/10.42: Appending PATH environment variable: C:\Users\Jonathon\.conan2\p\pcre2e09694aa47719\p\bin libgettext/0.22: Already installed! (6 of 7) glib/2.78.3: Already installed! (7 of 7) WARN: deprecated: Usage of deprecated Conan 1.X features that will be removed in Conan 2.X: WARN: deprecated: 'cpp_info.names' used in: bzip2/1.0.8, libiconv/1.17, libgettext/0.22, zlib/1.3.1, pcre2/10.42 WARN: deprecated: 'cpp_info.build_modules' used in: bzip2/1.0.8 WARN: deprecated: 'env_info' used in: glib/2.78.3, bzip2/1.0.8, libiconv/1.17, pcre2/10.42 ======== Finalizing install (deploy, generators) ======== conanfile.txt: Writing generators to C:\Users\Jonathon\source\tlsdump-main\tlsdump-main\build conanfile.txt: Generator 'CMakeDeps' calling 'generate()' conanfile.txt: CMakeDeps necessary find_package() and targets for your CMakeLists.txt find_package(glib) target_link_libraries(... glib::glib) conanfile.txt: Generator 'CMakeToolchain' calling 'generate()' conanfile.txt: CMakeToolchain generated: conan_toolchain.cmake conanfile.txt: Preset 'conan-default' added to CMakePresets.json. Invoke it manually using 'cmake --preset conan-default' if using CMake>=3.23 conanfile.txt: If your CMake version is not compatible with CMakePresets (<3.23) call cmake like: 'cmake <path> -G "Visual Studio 17 2022" -DCMAKE_TOOLCHAIN_FILE=C:\Users\Jonathon\source\tlsdump-main\tlsdump-main\build\conan_toolchain.cmake -DCMAKE_POLICY_DEFAULT_CMP0091=NEW' conanfile.txt: CMakeToolchain generated: CMakePresets.json conanfile.txt: CMakeToolchain generated: ..\CMakeUserPresets.json conanfile.txt: Generating aggregated env files conanfile.txt: Generated aggregated env files: ['conanbuild.bat', 'conanrun.bat'] Install finished successfully -- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.19045. -- Checking for one of the modules 'glib-2.0' CMake Error at C:/Program Files/CMake/share/cmake-3.29/Modules/FindPkgConfig.cmake:927 (message): None of the required 'glib-2.0' found Call Stack (most recent call first): CMakeLists.txt:20 (pkg_search_module) -- Configuring incomplete, errors occurred! C:\Users\Jonathon\source\tlsdump-main\tlsdump-main\build>cd .. C:\Users\Jonathon\source\tlsdump-main\tlsdump-main>conan install . --output-folder=build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake && cmake --build ======== Input profiles ======== Profile host: [settings] arch=x86_64 build_type=Release compiler=msvc compiler.cppstd=14 compiler.runtime=dynamic compiler.runtime_type=Release compiler.version=193 os=Windows Profile build: [settings] arch=x86_64 build_type=Release compiler=msvc compiler.cppstd=14 compiler.runtime=dynamic compiler.runtime_type=Release compiler.version=193 os=Windows ======== Computing dependency graph ======== Graph root conanfile.txt: C:\Users\Jonathon\source\tlsdump-main\tlsdump-main\conanfile.txt Requirements bzip2/1.0.8#457c272f7da34cb9c67456dd217d36c4 - Cache glib/2.78.3#0cd1865c8603d90b3bc5858065e16d01 - Cache libffi/3.4.4#35eb63842b505824b70aedc1baefc916 - Cache libgettext/0.22#2c87563d7a69544dd9379f038aca3b0b - Cache libiconv/1.17#73fefc1b696e069df90fd1d18aa63edd - Cache pcre2/10.42#a7a2c122056510509a7525c83d6a6695 - Cache zlib/1.3.1#f52e03ae3d251dec704634230cd806a2 - Cache Build requirements autoconf/2.71#f9307992909d7fb3df459340f1932809 - Cache automake/1.16.5#058bda3e21c36c9aa8425daf3c1faf50 - Cache m4/1.4.19#b38ced39a01e31fef5435bc634461fd2 - Cache meson/1.2.2#04bdfb85d665c82b08a3510aee3ffd19 - Cache msys2/cci.latest#5a31efa2bde593541fd5ac3bcc50c01c - Cache ninja/1.11.1#77587f8c8318662ac8e5a7867eb4be21 - Cache pkgconf/2.0.3#f996677e96e61e6552d85e83756c328b - Cache Resolved version ranges zlib/[>=1.2.11 <2]: zlib/1.3.1 ======== Computing necessary packages ======== Requirements bzip2/1.0.8#457c272f7da34cb9c67456dd217d36c4:67bfcb7b4b78262b9d05495e479dcd92f747316b#cea9c0f0dfa41e83aebd5d39c5a5cbf3 - Cache glib/2.78.3#0cd1865c8603d90b3bc5858065e16d01:750e9c8cf560085c96c0fa42531c45c18af8be50#29d02404508c39a0803c3bee40426924 - Cache libffi/3.4.4#35eb63842b505824b70aedc1baefc916:7bfde258ff4f62f75668d0896dbddedaa7480a0f#37e6c892e9418389fcf21227e9c1ae6b - Cache libgettext/0.22#2c87563d7a69544dd9379f038aca3b0b:55052839d1d508208c0cd4c7594a7001c70287d1#bea6a5629dc31a80b4d489e5ef163ec4 - Cache libiconv/1.17#73fefc1b696e069df90fd1d18aa63edd:7bfde258ff4f62f75668d0896dbddedaa7480a0f#9ef92719f5c05dca2f0dbb46f50d3f8d - Cache pcre2/10.42#a7a2c122056510509a7525c83d6a6695:1bbffc30d8479a890917ef6674ab5e5f3c5b2036#d6a7c0162d1450645a9d56832ca25ae6 - Cache zlib/1.3.1#f52e03ae3d251dec704634230cd806a2:7bfde258ff4f62f75668d0896dbddedaa7480a0f#20d10b761ec15eed7a1d61c86bc7415a - Cache Build requirements Skipped binaries autoconf/2.71, automake/1.16.5, m4/1.4.19, meson/1.2.2, msys2/cci.latest, ninja/1.11.1, pkgconf/2.0.3 ======== Installing packages ======== bzip2/1.0.8: Already installed! (1 of 7) zlib/1.3.1: Already installed! (2 of 7) libiconv/1.17: Already installed! (3 of 7) libffi/3.4.4: Already installed! (4 of 7) pcre2/10.42: Already installed! (5 of 7) pcre2/10.42: Appending PATH environment variable: C:\Users\Jonathon\.conan2\p\pcre2e09694aa47719\p\bin libgettext/0.22: Already installed! (6 of 7) glib/2.78.3: Already installed! (7 of 7) WARN: deprecated: Usage of deprecated Conan 1.X features that will be removed in Conan 2.X: WARN: deprecated: 'cpp_info.names' used in: pcre2/10.42, libiconv/1.17, bzip2/1.0.8, zlib/1.3.1, libgettext/0.22 WARN: deprecated: 'cpp_info.build_modules' used in: bzip2/1.0.8 WARN: deprecated: 'env_info' used in: pcre2/10.42, bzip2/1.0.8, glib/2.78.3, libiconv/1.17 ======== Finalizing install (deploy, generators) ======== conanfile.txt: Writing generators to C:\Users\Jonathon\source\tlsdump-main\tlsdump-main\build conanfile.txt: Generator 'CMakeDeps' calling 'generate()' conanfile.txt: CMakeDeps necessary find_package() and targets for your CMakeLists.txt find_package(glib) target_link_libraries(... glib::glib) conanfile.txt: Generator 'CMakeToolchain' calling 'generate()' conanfile.txt: CMakeToolchain generated: conan_toolchain.cmake conanfile.txt: Preset 'conan-default' added to CMakePresets.json. Invoke it manually using 'cmake --preset conan-default' if using CMake>=3.23 conanfile.txt: If your CMake version is not compatible with CMakePresets (<3.23) call cmake like: 'cmake <path> -G "Visual Studio 17 2022" -DCMAKE_TOOLCHAIN_FILE=C:\Users\Jonathon\source\tlsdump-main\tlsdump-main\build\conan_toolchain.cmake -DCMAKE_POLICY_DEFAULT_CMP0091=NEW' conanfile.txt: CMakeToolchain generated: CMakePresets.json conanfile.txt: CMakeToolchain generated: ..\CMakeUserPresets.json conanfile.txt: Generating aggregated env files conanfile.txt: Generated aggregated env files: ['conanbuild.bat', 'conanrun.bat'] Install finished successfully -- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.19045. -- Checking for one of the modules 'glib-2.78.3' CMake Error at C:/Program Files/CMake/share/cmake-3.29/Modules/FindPkgConfig.cmake:927 (message): None of the required 'glib-2.78.3' found Call Stack (most recent call first): CMakeLists.txt:20 (pkg_search_module) -- Configuring incomplete, errors occurred! 这对我来说真的没有意义,因为当它安装软件包时,它清楚地以亮绿色显示这一行:glib/2.78.3: Already installed! (7 of 7),然后不久之后,它仍然显示:-- Checking for one of the modules 'glib-2.78.3' CMake Error at C:/Program Files/CMake/share/cmake-3.29/Modules/FindPkgConfig.cmake:927 (message): None of the required 'glib-2.78.3' found 所以我真的不知道发生了什么。 glib 显然已安装,但由于某种原因 cmake pkgconfig 仍然找不到它。我做错了什么? 总结我在评论中的解释: 应该可以设置 PKG_CONFIG_PATH 环境变量以将其指向 glib 安装。 pkg-config 在此变量(以及其他一些变量)指定的目录中查找库。但是我宁愿推荐使用MSYS2,而不是进行手动配置。用它来安装您需要的所有工具:pacman -S mingw-w64-ucrt-x86_64-gcc mingw-w64-ucrt-x86_64-pkgconf mingw-w64-ucrt-x86_64-cmake mingw-w64-ucrt-x86_64-glib2。打开 MSYS2 终端并在其中进行编译(以设置正确的环境变量)。验证终端提示是否以洋红色文本显示 UCRT64(什么是 MSYS2 环境?如何选择一个?)。 您可以尝试pkg-config --libs --cflags glib-2.0并看到它找到该库。
如何在 Windows 程序中包含 FFMpeg 进行开发?
我正在尝试遵循有关使用 FFMpeg 库从 C++ 视频中提取帧的教程(作者:Bartholomew)。 为了包含库,根据教程,建议...
clion 不会将索引标头添加到 target_include_derectories
我使用 FindPkgConfig 然后使用 pkg_search_module 来查找我的依赖项。然后,我添加 _INCLUDE_DIRECTORIES 和 target_include_directories。 cmake 在控制台和 clion 中工作正常,但是......
当 pkg-config 似乎不起作用时,如何使用 cuda 示例构建一个简单的 opencv
我正在使用带有 Opencv 构建的 docker 容器,并从这里开始支持 CUDA 我使用的dockerfile(在基础上略有修改)是这个 现在我正在尝试通过简单的检查来检查...
对于一个历史上使用 make 的项目,我现在想生成一个 pkg-config 文件。但是我似乎无法阻止变量的替换 mylib.pc: echo '前缀='$(前缀...
pkgconf 无法找到 pc 文件,即使它存在于搜索路径中
我在 /usr/lib/pkgconfig 中有这个 my.pc 文件: 前缀=/usr exec_prefix=/usr libdir=${exec_prefix}/lib includedir=${前缀}/include 姓名:我的 描述:我很棒的图书馆 版本:0.0.1 库:-L${
我想转换这个命令行编译和构建: g++教程01.cpp -o教程01-std=c++17 -I /usr/local/include/webkitgtk-4.1/webkit2 $(pkg-config --cflags --libs gtk+-3.0 webkit2gt...
如何将 pkg-config 名称映射到 yum/apt-get
很多 makefile 使用 pkg-config,但名称与包管理器无关(例如 yum / apt)。如何将 pkg-config 名称映射到它们?有什么窍门吗? 示例:如果我执行 yum searchName --look thr...
我在 lubuntu 12.10 发行版上安装了 opencv。然后,当我尝试编译使用 opencv 的代码时,它说找不到它。所以我在终端尝试: pkg-config --cflags --libs opencv 它回答...