tags:

views:

58

answers:

1

Hi,

I'v created a C header file (It's compiled), now when i compile my program it comes up with tons of errors like:

warning: null character(s) ignored error: stray ‘\23’ in program TheFunctions.h:1722: error: stray ‘\200’ in program

Inside the header file is simply two functions, which work in the normal c program.

Please help!

+2  A: 

It sounds as though you're trying to directly include a precompiled header (a binary file). When you include files via the #include pre-processor statement, those are text files, not compiled files.

Edit (now that we know what compiler it is): I don't know GCC's precompiled headers stuff well enough to answer this question, but here's a link discussing them for what it's worth: http://gcc.gnu.org/onlinedocs/gcc/Precompiled-Headers.html

T.J. Crowder
Daniel
Is it possible to include precompiled headers at all?
Daniel
Is it possible to include compiled C Code?
Daniel
@Daniel: *"Is it possible to include precompiled headers at all?"* Yes, see the link. Different compilers do it differently. Note that in all implementations I've seen, though, the actual file you're `#include` ing is a *text* file; it's just that (in the GCC case) if you `#include <foo.h>` and you have previously pre-compiled `foo.h`, you'll have a `foo.h.pch` file. The compiler will see that and use it. *"Is it possible to include compiled C Code?"* Normally you compile code as a library, and then *link* with the library (rather than "including" it).
T.J. Crowder