Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

Error: Cannot open source file 'stddef.h'

Thomas_W_4
Beginner
3,236 Views

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 

0 Kudos
12 Replies
Thomas_W_4
Beginner
3,236 Views

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.

0 Kudos
SergeyKostrov
Valued Contributor II
3,236 Views
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 ).
0 Kudos
Thomas_W_4
Beginner
3,236 Views

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.

0 Kudos
Thomas_W_4
Beginner
3,236 Views

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

0 Kudos
SergeyKostrov
Valued Contributor II
3,236 Views
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
0 Kudos
Thomas_W_4
Beginner
3,236 Views

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. 

0 Kudos
SergeyKostrov
Valued Contributor II
3,236 Views
Please check that stddef.h is in $(VCInstallDir)include directory. Also, there is No ';' between these two paths: ...$(VCInstallDir)crt$(WindowsSdkDir)include;...
0 Kudos
Thomas_W_4
Beginner
3,236 Views

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?

0 Kudos
SergeyKostrov
Valued Contributor II
3,236 Views
>>...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.
0 Kudos
Thomas_W_4
Beginner
3,236 Views

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.

0 Kudos
TimP
Honored Contributor III
3,236 Views

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.

0 Kudos
SergeyKostrov
Valued Contributor II
3,236 Views
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?
0 Kudos
Reply