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
-
Have you confirmed that the package is installed? `sudo apt-get install gtksourceview-3.0` – Eddie Flores Aug 25 '13 at 23:23
-
yes package is installed – user2716394 Aug 25 '13 at 23:28
-
1Install the header files: `sudo apt-get install libgtksourceview-3.0-dev` (on Debian based systems) – Lasall Aug 26 '13 at 20:31
-
it is already installed. when i try the above command it says, libgtksourceview-3.0-dev is already the newest version – user2716394 Aug 26 '13 at 20:40
-
3Show your makefile, show your sources, without it is just blind guessing – drahnr Aug 26 '13 at 20:56
2 Answers
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

- 1,094
- 13
- 23
--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

- 41
- 2