NMAKE无法在子文件夹中找到包含文件 [英] NMAKE can't find include file in subfolder

查看:91
本文介绍了NMAKE无法在子文件夹中找到包含文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用带有-I选项的Microsoft的NMAKE来包含路径.它适用于这些文件夹中的包含文件,但似乎无法在已命名的子文件夹中找到一个文件:

Using Microsoft's NMAKE with -I option to for include paths. It works for the include files in these folders, but can't seem to find one in a named subfolder:

这是结果命令&错误消息:

Here's the resulting command & error message:

cl /nologo /Ox /MD /EHsc /W3 /D_CRT_SECURE_NO_DEPRECATE -I "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\sys"; -I.    "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\sys" "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include" "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include" -DAVOID_WIN32_FILEIO -DCHECK_JPEG_YCBCR_SUBSAMPLING -DDEFAULT_EXTRASAMPLE_AS_ALPHA -DSTRIPCHOP_DEFAULT=TIFF_STRIPCHOP -DSTRIP_SIZE_DEFAULT=8192 -DLOGLUV_SUPPORT -DNEXT_SUPPORT -DTHUNDER_SUPPORT -DLZW_SUPPORT -DPACKBITS_SUPPORT -DCCITT_SUPPORT -DTIF_PLATFORM_CONSOLE -DFILLODER_LSB2MSB  /c tif_unix.c

tif_unix.c
tif_unix.c(35) : fatal error C1083: Cannot open include file: 'sys/types.h': No such file or directory

需要注意的两件事:

  1. 丢失"文件"types.h"位于包含路径之一的"sys"子文件夹中,因此应找到"sys/types.h",并且

  1. The "missing" file, "types.h", IS in the "sys" subfolder of one of the include paths, so "sys/types.h" should have been found, and

还包括了"sys"子文件夹(出于绝望)和类型.找不到STILL.

The "sys" subfolder was also included (out of desperation) and types.h STILL wasn't found.

找不到包含此包含文件的任何想法吗?

Any ideas why this include file can't be found?

推荐答案

您似乎没有正确使用该选项.语法是 -I目录,并且根据Microsoft文档,

It looks like you're not using the option correctly. The syntax is -I directory, and according to the Microsoft documentation, to add more than one directory, you must use this option more than once. If you have faithfully reproduced the actual command-line you're using, then you have got -I directory -I directory directory directory directory, so several of your include directories are ignored.

假设您希望所有这些目录都包含在include路径中,则正确的语法为:

Assuming you want all of these directories in the include path, the correct syntax is:

-I "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\sys"
-I.
-I "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\sys"
-I "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include"
-I "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include"

请注意在每个目录之前的 -I 的使用,其中包括 ..

Note the use of -I before each directory, including . .

这篇关于NMAKE无法在子文件夹中找到包含文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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