简体   繁体   中英

MSYS2: pkg-config doesn't resolve/list dependencies of gtk+-3.0

after I successfully set up my gcc/g++ environment under my Linux installation, I decided to do that for my Windows 11 machine as well. For that purpose I decided to use MSYS2. With the help of that handy tool I quickly installed MinGW as well as corresponding libraries. One library which gives me headache (under Windows) is pkg-config. But before the installation of pkg-config, I installed gtk-3.0 first. I just installed it with the following command:

pacman -S mingw-w64-x86_64-gtk3

After that I installed pkg-config with the following command:

pacman -S mingw-w64-x86_64-pkg-config

After that, I tried to get all include and library flags for gtk3:

pkg-config --cflags gtk+-3.0

However after entering that command, the following error message occurs:

Perhaps you should add the directory containing `gtk+-3.0.pc'
to the PKG_CONFIG_PATH environment variable
Package 'gtk+-3.0', required by 'virtual:world', not found

The thing is that this exact command works like a charm under my Linux installation but somehow pkg-config can't find the package in the pkg-config search path. Why is that the case? Is that a known problem within the MSYS2 environment?

I would appreciate every tip I can get from you.

Thank you in advance!

EDIT: It looks like I just had to start the MinGW64 shell and not the one from MSYS2. Within that environment the files can be found and no error will occur. Thanks @HolyBlackCat!

The following answer is outdated, written in italic style and shouldn't be followed.

I just solved it by myself. I found out that I had to copy all.pc files from msys64\mingw64\lib\pkgconfig to the path I get from echoing PKG_CONFIG_PATH: echo $PKG_CONFIG_PATH gives me /usr/lib/pkgconfig:/usr/share/pkgconfig:/lib/pkgconfig So I just copied the files to /usr/lib/pkgconfig - problem solved: Thank you anyway! :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM