在 Windows 中获取介子项目的 Msys2 包
我写了我的meson.build
文件,如下所示:
project('tutorial', 'cpp')
my_dependency = dependency('curl')
executable('demo', 'main.cpp', dependencies : my_dependency)
...并使用Meson设置builddir
设置Meson,但它失败了,以下错误:
The Meson build system
Version: 0.62.0
Source dir: C:\Users\woose\example
Build dir: C:\Users\woose\example\builddir
Build type: native build
Project name: tutorial
Project version: undefined
C++ compiler for the host machine: c++ (gcc 11.2.0 "c++ (Rev10, Built by MSYS2 project) 11.2.0")
C++ linker for the host machine: c++ ld.bfd 2.38
Host machine cpu family: x86_64
Host machine cpu: x86_64
Found pkg-config: C:\msys64\mingw64\bin\pkg-config.EXE (1.8.0)
Did not find CMake 'cmake'
Found CMake: NO
Run-time dependency curl found: NO (tried pkgconfig)
meson.build:2:0: ERROR: Dependency "curl" not found, tried pkgconfig
A full log can be found at C:\Users\woose\example\builddir\meson-logs\meson-log.txt
如何解决?
Let me assume that I wanna use curl
package in msys2 for my C++ project.
So I add msys2 path to %Path%
in system environment.
and I write my meson.build
file like below:
project('tutorial', 'cpp')
my_dependency = dependency('curl')
executable('demo', 'main.cpp', dependencies : my_dependency)
... and setup the meson with meson setup builddir
but it fails with following error:
The Meson build system
Version: 0.62.0
Source dir: C:\Users\woose\example
Build dir: C:\Users\woose\example\builddir
Build type: native build
Project name: tutorial
Project version: undefined
C++ compiler for the host machine: c++ (gcc 11.2.0 "c++ (Rev10, Built by MSYS2 project) 11.2.0")
C++ linker for the host machine: c++ ld.bfd 2.38
Host machine cpu family: x86_64
Host machine cpu: x86_64
Found pkg-config: C:\msys64\mingw64\bin\pkg-config.EXE (1.8.0)
Did not find CMake 'cmake'
Found CMake: NO
Run-time dependency curl found: NO (tried pkgconfig)
meson.build:2:0: ERROR: Dependency "curl" not found, tried pkgconfig
A full log can be found at C:\Users\woose\example\builddir\meson-logs\meson-log.txt
How can I fix it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我修好了。另外,添加了包含目录。
I fixed it. plus, added include directories.