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

*.h: File Format Not Recognized

mikec_ee99
Beginner
662 Views
I am trying to compile a very simple application. I was able to get it to compile with gcc, but icc is giving me this error:
block.h: File Format Not Recognized
I'm building it on Linux using icc version 10.0.026. When I do a file block.h I get the correct format ASCII English Text. I see that people have had problem with icc file formats for libraries, but this is a simple header file! Any ideas as to what might be going on? Thanks....
0 Kudos
3 Replies
jimdempseyatthecove
Honored Contributor III
662 Views

It would seem like the file with the name of block.h that you examined may not be the file with the name of block.h that you are including into your program (the conflicting name may be comming first in the include directory path).

Try placing a

#error test error

in the front of the file you think is being included.

Then if the compilation stops with error message then the file you edited is the file included
Or, if the compilation stops with the File Format Not Recognized, then you may have two files of the name block.h

Also, check to make sure that block.h was not written with a word processor (e.g. Word or WordPad or OpenOffice equivilent). They should be written with a text file editor. (i.e. no hidden font selection and formatting text).

Jim Dempsey

0 Kudos
mikec_ee99
Beginner
662 Views
I found the problem. I had the header files listed in the compiler command line. Unlike gcc, icc doesn't like that.
0 Kudos
John_O_Intel
Employee
662 Views

Quoting - mikec_ee99

I found the problem. I had the header files listed in the compiler command line. Unlike gcc, icc doesn't like that.


Glad you found the problem. gcc will compile a header file to a pre-compiled header, icc requires a C or C++ file.

Regards,

John)
0 Kudos
Reply