gcc引发“无法识别的命令行选项"pkg-config错误 [英] gcc raises "unrecognized command line option" error with pkg-config

查看:163
本文介绍了gcc引发“无法识别的命令行选项"pkg-config错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用此处的教程来编译gtk程序.当我发出命令时

I am trying to compile a gtk program using the tutorial here. When I issue the command

gcc -o tut tut.c $(pkg-config --cflags --libs gtk+-2.0 gmodule-2.0)

我收到以下错误:

gcc: error: unrecognized command line option ‘-pthread -I/usr/include/gtk-2.0
-I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0
-I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0
-I/usr/include/gio-unix-2.0/ -I/usr/include/freetype2 -I/usr/include/glib-2.0
-I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1
-I/usr/include/libpng12 -I/usr/include/harfbuzz  -Wl,--export-dynamic -pthread
-lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0
-lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfontconfig -lgobject-2.0 -lfreetype
-lgmodule-2.0 -lglib-2.0  ’

gcc是版本4.8.2.pkg-config是0.26版.我已经安装了libgtk2.0-dev.

gcc is version 4.8.2. pkg-config is version 0.26. i have libgtk2.0-dev installed.

我可以很好地编译简单的c程序.

I can compile simple c programs fine.

如何解决无法识别的命令"问题?

How do I resolve the "unrecognized command" problem?

[评论更新]

我正在使用 zsh .

推荐答案

这看起来像是外壳问题.

This looks like a shell issue.

您正在使用什么外壳?

如果不是 bash ,请尝试 bash .

这篇关于gcc引发“无法识别的命令行选项"pkg-config错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆