gpt4 book ai didi

c - Flycheck 和 Clutter - 我该如何设置?

转载 作者:太空宇宙 更新时间:2023-11-04 02:47:13 27 4
gpt4 key购买 nike

我已经使用 Flycheck 一段时间了,但我不确定如何让它正确识别 Clutter。根据我找到的教程,我将这个(非常简单的)程序输入到 Emacs 中:

#include <stdlib.h>
#include <clutter/clutter.h>

//draws a basic, black window
int main(int argc, char *argv[])
{
ClutterInitError e = clutter_init(&argc, &argv); //pass it any
//options - these
//can be fed
if (e == CLUTTER_INIT_SUCCESS) {
ClutterColor stage_color = {0, 0, 0, 255}; //RGBA [0, 255]
ClutterActor *stage = clutter_stage_new();
clutter_actor_set_size(stage, 512, 512);
clutter_actor_set_background_color(stage, &stage_color);
clutter_actor_show(stage);
clutter_main();
return EXIT_SUCCESS;
} else {
return 1;
}
}

现在,在其中的第 2 行(#include <clutter/clutter.h>),我从 Flycheck 收到一条关于无法找到 clutter/clutter.h 的警告.很公平 - 在编译器中,我需要使用 pkg-config成功编译它。在我的系统上,pkg-config clutter-1.0 --cflags --libs输出:

-pthread -I/usr/include/clutter-1.0 -I/usr/include/pango-1.0 -I/usr/include/cogl -I/usr/include/cairo -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/harfbuzz -I/usr/include/libpng16 -I/usr/include/cogl -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/libdrm -I/usr/include/json-glib-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -lclutter-1.0 -lcogl-path -lcairo-gobject -latk-1.0 -lpangocairo-1.0 -lpango-1.0 -lcairo -lcogl-pango -lcogl -lgmodule-2.0 -pthread -lgdk_pixbuf-2.0 -lwayland-egl -lgbm -ldrm -lEGL -lXrandr -ljson-glib-1.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lwayland-cursor -lwayland-client -lxkbcommon -lwayland-server -lX11 -lXext -lXdamage -lXfixes -lXcomposite -lXi

现在,我有点像 C 菜鸟(还有一点 Flycheck 菜鸟),所以请多多包涵。我知道我需要使用 M-x customize-group flycheck-options ,在那里,我需要将一些东西放入 Flycheck GCC Include PathFlycheck GCC Includes .但是,我不知道上面输出的哪一部分(如果有的话)去了哪里?我非常感谢您的帮助,这样一来,当我使用其他库时,我就会知道如何正确设置它们。

最佳答案

pkg-config clutter-1.0 --cflags --libs 输出中所有以 -I 为前缀的路径都是包含路径。

具体来说:

/usr/include/clutter-1.0
/usr/include/pango-1.0
/usr/include/cogl
/usr/include/cairo
/usr/include/atk-1.0
/usr/include/pango-1.0
/usr/include/cairo
/usr/include/pixman-1
/usr/include/freetype2
/usr/include/libpng16
/usr/include/harfbuzz
/usr/include/freetype2
/usr/include/harfbuzz
/usr/include/libpng16
/usr/include/cogl
/usr/include/gdk-pixbuf-2.0
/usr/include/libpng16
/usr/include/libdrm
/usr/include/json-glib-1.0
/usr/include/glib-2.0
/usr/lib/glib-2.0/include

将这些添加到 Flycheck GCC 包含路径

关于c - Flycheck 和 Clutter - 我该如何设置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26009905/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com