0
votes

I am trying to write an application using c++. I have decided to use gtk3+ and the gtk opengl extensions. Bellow is the build command i am running

gcc -Wall `pkg-config --cflags "gtk+-3.0 gtkglext-1.2.0"`   -c -o main.o main.c

This creates the bellow output error

Package gtkglext-1.2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtkglext-1.2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtkglext-1.2.0' found

If instead of using gtkglext-1.2.0 i use gtkglext-1.0 then this causes alot of compiler warnings.

How can i setup pkg-config properly? Note: I have brew installed gtk3+ and gtkglext

UPDATE:

howbrew has installed gtkglext-1.2.0 but there is only gtkglext-1.0.pc & gtkglext-x11-1.0.pc available. Bellow is the new build command

gcc -Wall `pkg-config --cflags "gtk+-3.0 gtkglext-1.0 gtkglext-x11-1.0"`   -c -o main.o main.c

This causes lots of compile errors, bellow is a sample

In file included from main.c:9: In file included from /usr/local/Cellar/gtkglext/1.2.0/include/gtkglext-1.0/gtk/gtkgl.h:22: In file included from /usr/local/Cellar/gtkglext/1.2.0/include/gtkglext-1.0/gdk/gdkgl.h:34: In file included from /usr/local/Cellar/gtkglext/1.2.0/include/gtkglext-1.0/gdk/gdkglpixmap.h:25: In file included from /usr/local/Cellar/gtk+/2.24.25/include/gtk-2.0/gdk/gdkpixmap.h:35: In file included from /usr/local/Cellar/gtk+/2.24.25/include/gtk-2.0/gdk/gdkdrawable.h:35: /usr/local/Cellar/gtk+/2.24.25/include/gtk-2.0/gdk/gdkgc.h:198:23: error: a parameter list without types is only allowed in a function definition GdkColormap *GSEAL (colormap); ^ /usr/local/Cellar/gtk+/2.24.25/include/gtk-2.0/gdk/gdkgc.h:198:16: error: duplicate member 'GSEAL' GdkColormap *GSEAL (colormap); ^ /usr/local/Cellar/gtk+/2.24.25/include/gtk-2.0/gdk/gdkgc.h:193:8: note: previous declaration is here gint GSEAL (clip_x_origin); ^ /usr/local/Cellar/gtk+/2.24.25/include/gtk-2.0/gdk/gdkgc.h:205:27: error: unknown type name 'GdkGC' void (*get_values) (GdkGC
*gc, ^ /usr/local/Cellar/gtk+/2.24.25/include/gtk-2.0/gdk/gdkgc.h:207:27: error: unknown type name 'GdkGC' void (*set_values) (GdkGC
*gc, ^ /usr/local/Cellar/gtk+/2.24.25/include/gtk-2.0/gdk/gdkgc.h:210:27: error: unknown type name 'GdkGC' void (*set_dashes) (GdkGC
*gc, ^ /usr/local/Cellar/gtk+/2.24.25/include/gtk-2.0/gdk/gdkgc.h:225:1: error: unknown type name 'GdkGC' GdkGC *gdk_gc_new
(GdkDrawable *drawable);

1

1 Answers

0
votes

Brew is OSX, right? I don't know much about OSX dev, but in general the pkg-config files get dumped in $prefix/lib/pkgconfig, where prefix depends on what you passed to the configure script, cmake, our whatever underlying build system the package in question uses. Either you can reinstall with a different prefix option or you can modify the PKG_CONFIG_PATH environment variable when building your app like this:

PKG_CONFIG_PATH=$prefix/lib/pkgconfig:$ PKG_CONFIG_PATH gcc command here

Which prepends the correct location of the pkg-config files to PKG_CONFIG_PATH. Where these are I can't tell you, as I know not brew and OSX, but once you find it you're golden. The files should be named gtk+-3.0.pc and gtkglext-1.2.0.pc respectively.