[英]error while compiling: gtksourceview/gtksource.h: No such file or directory
I am trying to make autocompletion using Gtk.SourceView. 我正在尝试使用Gtk.SourceView进行自动完成。 I added --pkg gtksourceview-3.0 in the makefile.
我在makefile中添加了--pkg gtksourceview-3.0。 Now when I try to make, it gives fatal error: gtksourceview/gtksource.h: No such file or directory
现在,当我尝试制作时,它会给出致命的错误:gtksourceview / gtksource.h:没有这样的文件或目录
Valac (or better gcc) search (by default) header files in /usr/include and /usr/local/include/ . Valac(或更好的gcc)搜索(默认情况下) / usr / include和/ usr / local / include /中的头文件。 Maybe apt-get did not copy these files in /usr/include/ .
也许apt-get没有在/ 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 ) 1.打开gtksourceview-3.0软件包(vapi文件的默认路径是/ usr / share / vala / vapi或/usr/share/vala-0.20/vapi )
2.Checks [cheader_filename]: if it is something like: 2.Checks [cheader_filename]:如果它是这样的:
[CCode (cprefix..., cheader_filename = "gtksourceview/gtksource.h")]
then valac tries to use /usr/include/gtksourceview/gtksource.h or /usr/local/include/gtksourceview/gtksource.h 然后valac尝试使用/usr/include/gtksourceview/gtksource.h或/usr/local/include/gtksourceview/gtksource.h
3.Check if /usr/include/gtksourceview contains gtksource.h 3.检查/ usr / include / gtksourceview是否包含gtksource.h
4.If not, search your gtksource.h : we suppose that is in /usr/include . 4.如果没有,请搜索gtksource.h :我们假设它位于/ 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 :) --pkg仅用于vala传递,如果你做了C传递,你需要手动为gcc做pkg-config所以,基本上你必须在configure.ac中要求gtksourceview,这样他们就可以进入那些做了诡计的cflags :)
thanks to friendly people on #vala irc channel 感谢#vala irc频道的友好人士
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.