Why does the ICC say cannot open a precompiled header, even though the name was properly written in the properties?

Why does the ICC say cannot open a precompiled header, even though the name was properly written in the properties?

Hello,
I am using ICC(Intel C++ Compiler, no ofence though, I am sure everyone knows that acronym quiet well here : ) ) to compile a project.
-------------------
1>
1>npc_eli.cpp
1>compilation aborted for ..\shared\test_ehandle.cpp (code 4)
1>Command-line error: cannot open precompiled header input file .\Release_hl2\Server.pchi
--------------------
If you compare the error message above with the attached picture, you will see the added letter I at the end of the name of the precompiled header. Why? How do I fix that?

AttachmentSize
Downloadimage/jpeg pchi.JPG58.43 KB
7 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Quoting - zgzg2020
If you compare the error message above with the attached picture, you will see the added letter I at the end of the name of the precompiled header. Why? How do I fix that?

Could you please attach your build-log (buildlog.html) file?
Also, what's the value of $(IntDir) and $(TargetName)?

Are you creating the precompiled header (/Yc) from a source file using the Intel compiler as well? You need to be using this PCH model.

Brandon Hewitt
Technical Consulting Engineer

For 1:1 technical support: http://premier.intel.com

Software Product Support info: http://www.intel.com/software/support

Quoting - J.D. Patel (Intel)

Could you please attach your build-log (buildlog.html) file?
Also, what's the value of $(IntDir) and $(TargetName)?

You mean this one?

Attachments: 

AttachmentSize
Downloadtext/html BuildLog.htm10.28 KB

Quoting - Brandon Hewitt (Intel)

Are you creating the precompiled header (/Yc) from a source file using the Intel compiler as well? You need to be using this PCH model.

What do you mean by "this PCH model"?

Quoting - zgzg2020

What do you mean by "this PCH model"?

I meant that you shouldn't use the Microsoft compiler to create the PCH file, then use the Intel compiler on files that use it.

However, your build log shows the problem which is not due to mixing compilers. The compilation on stdafx.cpp fails, so the .pchi file (which is a pre-compiled header file that the Intel compiler creates) never gets created. The first error I saw wasdue to the use ofa "RESTRICT" macro. Iread in another thread that you canadd the "-DRESTRICT=restrict -Qrestrict" options to your compiler options, and that should resolve that error, although I'm not that familiar with restrict being used as a function declaration qualifier. If you have problems with that let us know.

Brandon Hewitt
Technical Consulting Engineer

For 1:1 technical support: http://premier.intel.com

Software Product Support info: http://www.intel.com/software/support

No, the restrict qualifier (extension to C++ of the C99 restrict) applies to pointers. Several compilers have an analogous way of handling it, hence the practice of a macro for definition/undefinition. I brought it up in part to warn about possible confusion, in case this project uses it in a sense other than the most common one.

Leave a Comment

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