简体   繁体   中英

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

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

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

--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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM