*.h: File Format Not Recognized

*.h: File Format Not Recognized

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....

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

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

www.quickthreadprogramming.com

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

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)

Leave a Comment

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