error while compiling: gtksourceview/gtksource.h: No such file or directory

1.4k views Asked by At

I am trying to make autocompletion using Gtk.SourceView. I added --pkg gtksourceview-3.0 in the makefile. Now when I try to make, it gives fatal error: gtksourceview/gtksource.h: No such file or directory

2

There are 2 answers

0
o3o On

Valac (or better gcc) search (by default) header files in /usr/include and /usr/local/include/. Maybe apt-get did not copy these files in /usr/include/.

So:

1.Open gtksourceview-3.0 package (default path of vapi files is /usr/share/vala/vapi or /usr/share/vala-0.20/vapi)

2.Checks [cheader_filename]: if it is something like:

  [CCode (cprefix..., cheader_filename = "gtksourceview/gtksource.h")]

then valac tries to use /usr/include/gtksourceview/gtksource.h or /usr/local/include/gtksourceview/gtksource.h

3.Check if /usr/include/gtksourceview contains gtksource.h

4.If not, search your gtksource.h: we suppose that is in /usr/include. Then create a symbolic link:

# ln -sf /usr/include/gtksource.h /usr/include/gtksourceview/gtksource.h

0
user2716394 On

--pkg is only for the vala pass, if you do a C pass you need to do pkg-config manually for gcc So, basically you have to require gtksourceview in the configure.ac so that they go in the cflags that did the trick :)

thanks to friendly people on #vala irc channel