summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile4
-rw-r--r--gauss_cv.c9
2 files changed, 10 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index d80fd4c..8d2c866 100644
--- a/Makefile
+++ b/Makefile
@@ -19,8 +19,8 @@ capture_LIBS=$(shell pkg-config --libs gtk+-3.0 opencv glib-2.0)
unvignette_CFLAGS=$(shell pkg-config --cflags cairo)
unvignette_LIBS=$(shell pkg-config --libs cairo) -lm
-gauss_cv_CFLAGS=$(shell pkg-config --cflags gtk+-3.0 gmodule-2.0 opencv)
-gauss_cv_LIBS=$(shell pkg-config --libs gtk+-3.0 gmodule-2.0 opencv)
+gauss_cv_CFLAGS=$(shell pkg-config --cflags gtk+-3.0 glib-2.0 gmodule-2.0 opencv)
+gauss_cv_LIBS=$(shell pkg-config --libs gtk+-3.0 glib-2.0 gmodule-2.0 opencv)
PROGS = wimmel wimmel_gl roi capture unvignette gauss_cv
OBJS = $(PROGS:=.o) util.o
diff --git a/gauss_cv.c b/gauss_cv.c
index da832ae..2f994b9 100644
--- a/gauss_cv.c
+++ b/gauss_cv.c
@@ -1,5 +1,6 @@
#include <string.h>
#include <gtk/gtk.h>
+#include <glib.h>
#include <cv.h>
#include <highgui.h>
@@ -208,14 +209,20 @@ main(int argc, char *argv[])
struct cvg cvg;
GtkBuilder *builder;
GObject *file_chooser;
+ gchar *path, *file;
memset(&cvg, 0, sizeof cvg);
gtk_init(&argc, &argv);
if (argc >= 2)
open_file(&cvg, argv[argc-1]);
+
builder = gtk_builder_new();
- gtk_builder_add_from_file(builder, "gauss_cv.ui", NULL);
+ path = g_path_get_dirname(argv[0]);
+ file = g_build_filename(path, "gauss_cv.ui", NULL);
+ gtk_builder_add_from_file(builder, file, NULL);
+ g_free(path);
+ g_free(file);
gtk_builder_connect_signals(builder, &cvg);
cvg.drawing_area1 = GTK_WIDGET(gtk_builder_get_object(builder,