OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Package gtk4 was not found in the pkg-config search path

  • Thread starter Thread starter user11323942
  • Start date Start date
U

user11323942

Guest
I've installed MSYS2 on Windows 7 and I have successfully executed

Code:
pacman -S mingw-w64-x86_64-gtk3

(the above as per Step 2 of Setting up GTK for Windows) and

Code:
pacman -S mingw-w64-x86_64-toolchain base-devel

but when I try to compile the hello world with

Code:
gcc -o hello-world-gtk hello-world-gtk.c `pkg-config --cflags --libs gtk4`

I get the following

Code:
Package gtk4 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk4.pc'
to the PKG_CONFIG_PATH environment variable
Package 'gtk4', required by 'virtual:world', not found
bash: gcc: command not found

If I try from MinGW 64-bit shell the output is

Code:
MyHome@MyHome-PC MINGW64 ~
$ gcc -o hello-world-gtk hello-world-gtk.c `pkg-config --cflags --libs gtk4`
Package gtk4 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk4.pc'
to the PKG_CONFIG_PATH environment variable
Package 'gtk4', required by 'virtual:world', not found
hello-world-gtk.c:1:10: fatal error: gtk/gtk.h: No such file or directory
    1 | #include <gtk/gtk.h>
      |          ^~~~~~~~~~~
compilation terminated.

I've also checked that

Code:
$ echo $PKG_CONFIG_PATH
/mingw64/lib/pkgconfig:/mingw64/share/pkgconfig
<p>I've installed MSYS2 on Windows 7 and I have successfully executed</p>
<pre><code>pacman -S mingw-w64-x86_64-gtk3
</code></pre>
<p>(the above as per <strong>Step 2</strong> of <a href="https://www.gtk.org/docs/installations/windows/" rel="nofollow noreferrer">Setting up GTK for Windows</a>) and</p>
<pre><code>pacman -S mingw-w64-x86_64-toolchain base-devel
</code></pre>
<p>but when I try to compile the <a href="https://www.gtk.org/docs/getting-started/hello-world/" rel="nofollow noreferrer">hello world</a> with</p>
<pre><code>gcc -o hello-world-gtk hello-world-gtk.c `pkg-config --cflags --libs gtk4`
</code></pre>
<p>I get the following</p>
<pre><code>Package gtk4 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk4.pc'
to the PKG_CONFIG_PATH environment variable
Package 'gtk4', required by 'virtual:world', not found
bash: gcc: command not found
</code></pre>
<p>If I try from MinGW 64-bit shell the output is</p>
<pre><code>MyHome@MyHome-PC MINGW64 ~
$ gcc -o hello-world-gtk hello-world-gtk.c `pkg-config --cflags --libs gtk4`
Package gtk4 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk4.pc'
to the PKG_CONFIG_PATH environment variable
Package 'gtk4', required by 'virtual:world', not found
hello-world-gtk.c:1:10: fatal error: gtk/gtk.h: No such file or directory
1 | #include <gtk/gtk.h>
| ^~~~~~~~~~~
compilation terminated.
</code></pre>
<p>I've also checked that</p>
<pre><code>$ echo $PKG_CONFIG_PATH
/mingw64/lib/pkgconfig:/mingw64/share/pkgconfig
</code></pre>
Continue reading...
 
Top