Error: Cannot open source file 'stddef.h'

Error: Cannot open source file 'stddef.h'

Hi,

I'm trying to compile a project using the Intel C++ 2011 Update 13 compiler. When trying to compile, I'm getting the error : cannot open source file 'stddef.h'. The includes in my project are:

$(ICInstallDir)compiler\include;$(ICInstallDir)compiler\include\ia32;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;t$(WindowsSdkDir)include;$(FrameworkSDKDir)\include; 

I can see that stddef.h exists in $(VCInstallDir)include, and I can open it fine. The error is in mkl_clas.h.

The other two erros that I have I assume to be related:

Intellisense : cannot open source file "stdlib.h" [mkl_service.h]
Intellisense : cannot open source file "stddef.h" [mkl_cblas.h]

Thanks for any help,
Thomas 

13 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Oh, I should add if it wasn't clear that I'm using Windows 7 and Visual Studio 2010. I'm using Composer 2011 because that's what the project was initially created with.

I use that version of Intel C++ compiler and I do not see any header related problems with VS 2005, VS 2008 and VS 2010.

There are No any errors in mkl_cblas.h header file ( I corrected to [stddef.h] because editor won't display stddef.h if arrow-left and arrow-right characters are used ).

...
#ifndef __MKL_CBLAS_H__
#define __MKL_CBLAS_H__

#include [stddef.h]

#include "mkl_types.h"

#ifdef __cplusplus
extern "C" { /* Assume C declarations for C++ */
#endif /* __cplusplus */
...

Please verify that you have a correct path for include directory [ VSInstallDir ]\VC\Include in VS global options ( Tools -> Options -> Project and Solutions -> VC++ Directories ).

I can't view VC++ Directories in VS global options as apparently it's deprecated. This is a screenshot of my workspace though, with the project options window opened.

Apparently the global VC++ directories screen is deprecated, but this is a screenshot of the the include path in my project properties.

You've looked at a right Property Page and a path to MKL include directory needs to be added to Include Directories item:

[ ICCInstallDirectory ]\[ Compiler ]\Mkl\include

Thanks, my include string is now:

$(ICInstallDir)compiler\include;$(ICInstallDir)compiler\include\ia32;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(VCInstallDir)crt$(WindowsSdkDir)include;$(FrameworkSDKDir)\include;$(ICInstallDir)mkl\include;

But this still hasn't sorted the problem. 

Please check that stddef.h is in $(VCInstallDir)include directory. Also, there is No ';' between these two paths:

...$(VCInstallDir)crt$(WindowsSdkDir)include;...

Hmmm, so I thought it was, but I think I've been looking in the wrong directory. It's in Visual Studio 11.0/vc/include, but not Visual Studio 10.0/vc/include.

Possibly a problem with having both VS2010 and VS2012 installed?

>>...It's in Visual Studio 11.0/vc/include, but not Visual Studio 10.0/vc/include.
>>
>>Possibly a problem with having both VS2010 and VS2012 installed?

Different versions of VSs perfectly co-exist on the same computer. So, could you try to do a Repair for both VSs?

Here is information for four major versions of VSs:

[ VS2005 Install Dir ]\VC\include\ -> stddef.h exists
[ VS2008 Install Dir ]\VC\include\ -> stddef.h exists
[ VS2010 Install Dir ]\VC\include\ -> stddef.h exists
[ VS2012 Install Dir ]\VC\include\ -> stddef.h exists

Note: For example, on my primary Ivy Bridge system I have 8 different VSs installed and there are No any issues with stddef.h.

I've run a repair on VS2010, but that hasn't added the file. I've taken a copy of the file from VS2010/VC/include, but that produces a list of errors about other missing files that are referenced by the copied stddef.h.

On my installation, VS2010 with full service packs has stddef.h just as VS2012.  I wouldn't be surprised if it may be an SP issue or that you may not have X64 components which come automatically on X64 OS.

Attached is a txt-file with a list of all header files located in ../VC/Include directory of Visual Studio 2010 Express Edition and use it for verification. If the problem still Not fixed try to uninstall your VS and install it again. By the way, what Edition do you have, Express, Standard, Professional, etc?

Attachments: 

AttachmentSize
Downloadtext/plain listofheaderfiles.txt9.98 KB

Leave a Comment

Please sign in to add a comment. Not a member? Join today