fatal error C1083: 无法打开包括文件:“getopt.h”: No such file or directory

sake92 2012-08-10 12:39:49
请问一下,为什么我用vs2010编译一个项目的时候会提示我这样的错误信息呢:fatal error C1083: 无法打开包括文件:“getopt.h”: No such file or directory
我已经下载了getopt.h文件并且放入工程里了啊。
请问各位高手该如何解决呢。谢谢啊!
...全文
2294 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
xiaomei__ 2014-09-04
  • 打赏
  • 举报
回复
还有种情况就是,你忘记把该h文件中对应的文件夹放在编译文件中了
suifeng3702 2013-07-31
  • 打赏
  • 举报
回复
lz问题解决了吗?我也遇到了这个问题,怎么解决的?
sake92 2012-08-10
  • 打赏
  • 举报
回复
一二楼的谢谢啊,特别是一楼的,资料以后会需要用到的。不过我的问题其实很低级的啦哈哈,就是三楼说的那种把那个文件所在路径添加到C++附加包含路径里。只是我添加之后还是一直报错,截个图上来,可以帮我指点一下,这样添加错在哪里么,谢谢你们了啊(本人菜鸟,问题确实是有点烦人
Gonefar 2012-08-10
  • 打赏
  • 举报
回复
[Quote=引用 9 楼 的回复:]

我试了用""、 <>和include "绝对路径"三种方法,都不行的说。我挺想知道像我在楼上截图的那样子配置附加包含目录的方式是不是错了呀,跪求指教!
[/Quote]
那应该是你用VS2010出问题了吧,你可以看看VS2010上手例程之类的,看看怎么操作。。
话说编个程要用到VS2010吗?多麻烦,可以用gcc,tc,dev等待啊
酱油党 2012-08-10
  • 打赏
  • 举报
回复
把getopt.h所在路径放在C++附加包含路径里
wqkjj 2012-08-10
  • 打赏
  • 举报
回复
该文件不在项目缺省的include文件下或者编译选项中没有加入include该文件所在的路径
sake92 2012-08-10
  • 打赏
  • 举报
回复
我试了用""、 <>和include "绝对路径"三种方法,都不行的说。我挺想知道像我在楼上截图的那样子配置附加包含目录的方式是不是错了呀,跪求指教!
Gonefar 2012-08-10
  • 打赏
  • 举报
回复
如果你把getopt.h放到你的工作目录,即你写得程序一块,用#include "getopt.h"。如果你是放到stdio.h类的文件一起,用#include <getopt.h>.如果是放到其它目录下,用#include "绝对路径"
sake92 2012-08-10
  • 打赏
  • 举报
回复
貌似上面回复的时候,添加的图片没法看到,重新添加一次。我这样子把文件放入附加包含路径的方式是不是有错误啊
sake92 2012-08-10
  • 打赏
  • 举报
回复
不行哟。放进去之后也没有用呢
夏天__ 2012-08-10
  • 打赏
  • 举报
回复
把getopt.h放在当前文件夹就可以了吧,
全志R16平台编译linux系统V1.0.txt 2017/4/11 13:36 (编译请使用编译android的lichee的选项编译生成的.config文件,不然直接编译会报错!!!!) rootroot@cm-System-Product-Name:/home/wwt/linux_r16$ tar zxvf lichee_parrotv1.1_20161202.tar.gz rootroot@cm-System-Product-Name:/home/wwt/linux_r16$ cd lichee/ rootroot@cm-System-Product-Name:/home/wwt/linux_r16/lichee$ ./build.sh config Welcome to mkscript setup progress All available chips: 0. sun8iw5p1 Choice: 0 All available platforms: 0. android 1. dragonboard 2. linux 3. tina Choice: 2 All available kernel: 0. linux-3.4 Choice: 0 All available boards: 0. bell-one 1. evb 2. evb-20 3. evb-30 4. evb-rtl8723bs 5. sc3813r Choice: 3 rootroot@cm-System-Product-Name:/home/wwt/linux_r16/lichee$ ./build.sh 错误1: KCONFIG_AUTOCONFIG=/home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/build/buildroot-config/auto.conf KCONFIG_AUTOHEADER=/home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/build/buildroot-config/autoconf.h KCONFIG_TRISTATE=/home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/build/buildroot-config/tristate.config BUILDROOT_CONFIG=/home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/.config /home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/build/buildroot-config/conf --silentoldconfig Config.in # # make dependencies written to .auto.deps # ATTENTION buildroot devels! # See top of this file before playing with this auto-preprequisites! # make[1]:正在离开目录 `/home/wwt/linux_r16/lichee/buildroot' You must install 'makeinfo' on your build machine makeinfo is usually part of the texinfo package in your distribution make: *** [dependencies] 错误 1 make:离开目录“/home/wwt/linux_r16/lichee/buildroot” ERROR: build buildroot Failed rootroot@cm-System-Product-Name:/home/wwt/linux_r16/lichee$ d/buildroot-config/conf.o /home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/build/buildroot-config/zconf.tab.o -o /home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buil

24,854

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 工具平台和程序库
社区管理员
  • 工具平台和程序库社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧