I have recently switched from openSuse to Ubuntu, and I'm having trouble compiling a project of mine (https://github.com/laleksic/URMulator) which worked flawlessly on openSuse.
Running make, I get the following:
laleksic@Lenovo-G560:~/Fakultet/URMulator$ make
gcc -g -w -std=c99 \
`pkg-config --cflags --libs glib-2.0 libgvc gtk+-2.0 gtksourceview-2.0 goocanvas` \
-IHeaders \
-o Executable/urm \
Sources/Main.c Sources/Register.c Sources/Instruction.c Sources/URM.c Sources/Graph.c Sources/GUI.c
Package goocanvas was not found in the pkg-config search path.
Perhaps you should add the directory containing `goocanvas.pc' to the PKG_CONFIG_PATH environment variable
No package 'goocanvas' found
In file included from Sources/Main.c:10:0:
Headers/Main.h:24:22: fatal error: glib.h: No such file or directory
compilation terminated.
In file included from Sources/Register.c:10:0:
Headers/Main.h:24:22: fatal error: glib.h: No such file or directory
compilation terminated.
In file included from Sources/Instruction.c:10:0:
Headers/Main.h:24:22: fatal error: glib.h: No such file or directory
compilation terminated.
In file included from Sources/URM.c:10:0:
Headers/Main.h:24:22: fatal error: glib.h: No such file or directory
compilation terminated.
In file included from Sources/Graph.c:10:0:
Headers/Main.h:24:22: fatal error: glib.h: No such file or directory
compilation terminated.
In file included from Sources/GUI.c:10:0:
Headers/Main.h:24:22: fatal error: glib.h: No such file or directory
compilation terminated.
Makefile:22: recipe for target 'Urmulator' failed
make: *** [Urmulator] Error 1
I have libglib2.0-dev installed, and glib-2.0.pc is in the right place, so I don't understand what is the problem, and would appreciate any help. Thanks.
Edit: Followed fkraiem's advice, now getting new set of errors. I had installed libgoocanvas-2.0 instead of libgoocanvas. This fixes the bit about goocanvas, though I still have quite a lot of errors. Too long a list to post, though it boils down to the fact that the compiler doesn't recognize any gtk, glib, or goocanvas functions...
gcc -g -w -std=c99 \
`pkg-config --cflags --libs glib-2.0 libgvc gtk+-2.0 gtksourceview-2.0 goocanvas` \
-IHeaders \
-o Executable/urm \
Sources/Main.c Sources/Register.c Sources/Instruction.c Sources/URM.c Sources/Graph.c Sources/GUI.c
/tmp/ccG4zuCY.o: In function `RegisterListCreate':
/home/laleksic/Fakultet/URMulator/Sources/Register.c:15: undefined reference to `g_list_append'
/tmp/ccG4zuCY.o: In function `RegisterListDestroy':
/home/laleksic/Fakultet/URMulator/Sources/Register.c:65: undefined reference to `g_list_free'
/tmp/ccG4zuCY.o: In function `RegisterCreateAndAppend':
/home/laleksic/Fakultet/URMulator/Sources/Register.c:80: undefined reference to `g_type_check_instance_cast'
...
/home/laleksic/Fakultet/URMulator/Sources/GUI.c:353: undefined reference to `gtk_box_pack_end'
/home/laleksic/Fakultet/URMulator/Sources/GUI.c:355: undefined reference to `gtk_widget_show'
/home/laleksic/Fakultet/URMulator/Sources/GUI.c:356: undefined reference to `gtk_widget_show'
/home/laleksic/Fakultet/URMulator/Sources/GUI.c:357: undefined reference to `gtk_widget_show'
/home/laleksic/Fakultet/URMulator/Sources/GUI.c:359: undefined reference to `gtk_widget_show'
/home/laleksic/Fakultet/URMulator/Sources/GUI.c:360: undefined reference to `gtk_widget_show'
/home/laleksic/Fakultet/URMulator/Sources/GUI.c:366: undefined reference to `gtk_main'
collect2: error: ld returned 1 exit status
Makefile:22: recipe for target 'Urmulator' failed
make: *** [Urmulator] Error 1
goocanvas
was not found, so installlibgoocanvas-dev
... – fkraiem Oct 13 '16 at 18:25-l
flags (output bypkg-config --libs
) must be at the end of the command. – fkraiem Oct 13 '16 at 20:11