User forums > General (but related to Code::Blocks)
Forum or Source of Information for Programming Issues Using Code::Blocks
mathguy:
I do have them in the compiled files using the #include. That's what's so perplexing.
oBFusCATed:
Have you read this: http://en.wikipedia.org/wiki/Header_file ?
I guess you come from java/.net background :)
mathguy:
Thank you. I will look that over. At first glance, I'm still confused. If I have a c source file that has #include "header.h" and the workspace has the source and header files listed, why wouldn't the header files be compiled and recognized? They are elsewhere. Pelles C, for example, compiles this same code with no problem (but I don't like the environment as much as CodeBlocks).
zabzonk:
It will either be compiled, or you will get an error message along the lines of:
--- Code: ---a.c:1:17: fatal error: bad.h: No such file or directory
--- End code ---
If you are getting this message, you simply need to add the directory that contains the headers to your project's search path (and of course #include the headers) via Project|Build Options|Search Directories. Simply adding the headers to the project is not sufficient to have them compiled.
mathguy:
I'm not getting that error. I'm getting "undefined reference" errors.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version