
Question:
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
Two things to note:
<ol><li>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
</li> <li>The "sys" subfolder was also included (out of desperation) and types.h STILL wasn't found.
</li> </ol>Any ideas why this include file can't be found?
Answer1:It looks like you're not using the option correctly. The syntax is -I directory
, and according to the Microsoft documentation, <a href="http://msdn.microsoft.com/en-us/library/73f9s62w%28v=vs.80%29.aspx" rel="nofollow">to add more than one directory, you must use this option more than once</a>. 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.
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"
Note the use of -I
before <em>each</em> directory, <em>including</em> .
.