gpt4 book ai didi

c - gcc 无法获取在包含目录参数中传递的文件

转载 作者:行者123 更新时间:2023-11-30 17:21:43 24 4
gpt4 key购买 nike

我已经安装了 http://win-builds.org 的 win-builds在 Windows 上,位于 c:\cygwins 目录。现在,当编译任何基本或 gtk 代码时,gcc 会抛出错误,指出找不到

gtk_test.c:1:21: fatal error: gtk/gtk.h: No such file or directory
#include <gtk/gtk.h>
^

button_example_01.c:1:24: fatal error: Elementary.h: No such file or directory
#include <Elementary.h>
^

我已经尝试按照 http://win-builds.org/1.5.0/msys-cygwin.html#_change_toolchain_on_the_fly 中提到的 win-builds 文档“source/opt/windows_64/bin/win-builds-switch”中的建议切换工具链。

如果是Elementary.h错误我可以找到这个文件 $ find /opt/windows_32/ -name 'Elementary.h'
/opt/windows_32/include/elementary-1/Elementary.h

此外,当我通过提供从 pkg-config 返回的 cflags 和 libs 值来编译程序时,该文件路径如下

/opt/windows_32/bin/i686-w64-mingw32-gcc -o button_example_01 button_example_01.c -I/opt/windows_32/include/elementary-1/ -I/opt/windows_32/include/efl-1 -I/opt/windows_32/include/ecore-win32-1 -I/opt/windows_32/include/efl-1 -I/opt/windows_32/include/ethumb-client-1 -I/opt/windows_32/include/efl-1 -I/opt/windows_32/include/ethumb-1 -I/opt/windows_32/include/efl-1 -I/opt/windows_32/include/edje-1 -I/opt/windows_32/include/efl-1 -I/opt/windows_32/include/embryo-1 -I/opt/windows_32/include/efl-1 -I/opt/windows_32/include/ecore-imf-evas-1 -I/opt/windows_32/include/efl-1 -I/opt/windows_32/include/ecore-evas-1 -I/opt/windows_32/include/efl-1 -I/opt/windows_32/include/ecore-input-evas-1 -I/opt/windows_32/include/efl-1 -I/opt/windows_32/include/emotion-1 -I/opt/windows_32/include/efl-1 -I/opt/windows_32/include/evas-1 -I/opt/windows_32/include/libpng14 -I/opt/windows_32/include/harfbuzz -I/opt/windows_32/include/fribidi -I/opt/windows_32/include -I/opt/windows_32/include/freetype2 -I/opt/windows_32/include -I/opt/windows_32/include/freetype2 -I/opt/windows_32/include -I/opt/windows_32/include/efl-1 -I/opt/windows_32/include/ecore-imf-1 -I/opt/windows_32/include/efl-1 -I/opt/windows_32/include/ecore-input-1 -I/opt/windows_32/include/efl-1 -I/opt/windows_32/include/efreet-1 -I/opt/windows_32/include/efl-1 -I/opt/windows_32/include/efreet-1 -I/opt/windows_32/include/efl-1 -I/opt/windows_32/include/efreet-1 -I/opt/windows_32/include/efl-1 -I/opt/windows_32/include/eldbus-1 -I/opt/windows_32/include/dbus-1.0 -I/opt/windows_32/lib/dbus-1.0/include -I/opt/windows_32/include/efl-1 -I/opt/windows_32/include/ecore-file-1 -I/opt/windows_32/include/efl-1 -I/opt/windows_32/include/ecore-con-1 -I/opt/windows_32/include -I/opt/windows_32/include/efl-1 -I/opt/windows_32/include/eio-1 -I/opt/windows_32/include/efl-1 -I/opt/windows_32/include/eet-1 -I/opt/windows_32/include -I/opt/windows_32/include/efl-1 -I/opt/windows_32/include/ecore-1 -I/opt/windows_32/include/efl-1 -I/opt/windows_32/include/eo-1 -I/opt/windows_32/include/efl-1 -I/opt/windows_32/include/eina-1 -I/opt/windows_32/include/eina-1/eina -I/opt/windows_32/include/efl-1 -I/opt/windows_32/include/evil-1 -L/opt/windows_32/lib -lelementary -lm -leina -lpthread -leet -levas -lecore -lecore_evas -lecore_file -lecore_input -ledje -leo -lethumb_client -lemotion -lecore_imf -lecore_con -leldbus -lefreet -lefreet_mime -lefreet_trash -leio -levil -lecore_win32 -lole32 -lgdi32 -lethumb_client -lethumb -ledje -lm -lembryo -lm -lecore_imf_evas -lecore_evas -lecore_input_evas -lemotion -levas -ljpeg -lm -lpng14 -lz -lharfbuzz -lfribidi -lfontconfig -lexpat -lfreetype -lexpat -lfreetype -lpng14 -llua -lm -lecore_imf -lecore_input -lefreet -lefreet_mime -lefreet_trash -leldbus -ldbus-1 -lpthread -lws2_32 -lecore_file -lecore_con -lm -lcares -lws2_32 -leio -lm -leet -lm -ljpeg -lz -lecore -lm -lintl -L/opt/windows_32/lib -leo -leina -lpthread -lm -liconv -levil
button_example_01.c:1:24: fatal error: Elementary.h: No such file or directory
#include "Elementary.h"
^
compilation terminated.

我猜测 gcc 不会解释 cygwin/opt/... 路径。如果有人能帮我解决这个问题,我将不胜感激?

最佳答案

fatal error :找不到“Elementary.h”文件似乎是一个常见问题。感谢杰夫对此的回答:http://forums.bodhilinux.com/index.php?/topic/12061-answered-help-compiling-elementary-code-examples/

这个答案还帮助我在 BodhiLinux 上编译 Elementary。当我在 FreeBSD 上尝试时,我也遇到了同样的错误,尽管我确实在系统中安装了 Elementary.h。我想到在 freebsd 的页面上检查 efl 的依赖关系:

https://www.freebsd.org/cgi/ports.cgi?query=enlightenment&stype=all

我检查了 efl-1.18.4 的每个依赖项,发现我必须添加:autoconf、automake、bullet、gmake、gmp、libdvdcss、libtool、pkgconf 和 png。这使得 cc 和 clang 的工作如下:

cc getstarted.c -o GetStarted `pkgconf elementary --cflags --libs`

如果您遇到问题,请检查依赖性。就我而言,我认为 pkgconf 完成了这项工作。

关于c - gcc 无法获取在包含目录参数中传递的文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28228234/

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