Is there way I could make my own header files?

Pages: 12
Hi, I was wondering if linux has a method to create your own personal header files like the stdio.h. Maybe somone might know a word to describe the keywords that gcc accepts in its programming. Like __time__. I'm not sure if __time__ is one of them but I remember running into something and I was hoping someone could point me in the right direction concerning this topic.
You can make your own header files. It's standard practice in C++ and is expected. A header file is just a text file containing C++ code.
I meant I want to make a header file that is included with greater then and less then symbols. Have any idea about that?
Yes. Make the file. The file is plain text with C++ code in it. Save that file somewhere that your compiler will find it. This means in the same place as your cpp files, or somewhere in the compiler's search path. Let's say that you've done that and named your file myHeaderFile.

Here is how you would include it:
#include <myHeaderFile>

If you had named it myHeaderFile.h, this is how you would include it:
#include <myHeaderFile.h>

I think you misunderstand header files. They're not anything special. They're just plain C++ code. That's all.

http://www.cplusplus.com/forum/articles/10627/
Last edited on
Man how can you not know what I'm talking about? have you ever used just C before if you include a header file with greater then or less then signs then it's a library header file.
I was asking if someone could point me in the right direction to making a gcc built in header file.
Every one tells me how to make normal header files when I ask that question.
What is a built in header file?
stdio.h?
I want to make functions that c programming doesn't provide.
Ok I feel kind of dumb now because I found out you can make dlls with c programming but that still leaves stuff not possible for me. Is there a better way to make dlls and header files for the dlls?
Last edited on
I don't think there is any difference between a "normal" header file and a library header file. The only difference I can think of is that standard headers and library headers are often put in special directories. #include <myHeaderFile.h> normally only search the directories where it finds the the standard headers and the library headers while #include "myHeaderFile.h" search additional directories.
Last edited on
Oh i thought you might be able to use asm for it or something. I was hoping there was some online documentation.

I thought c programming had limitations compared to asm and I wanted to make functions for my programming that isn't possible unless someone else makes something that probably wont be compatible with my computer.
I mean if there is a method or a html file on the subject I really want to know.
Last edited on
have you ever used just C before if you include a header file with greater then or less then signs then it's a library header file.


In C++ (and I suspect C) the difference between including using "xxx" and <xxx> is implementation dependent, and only affects the order in which directories are searched for the named header file.

What do you think the difference is between a library header file and one you make yourself? One of them came with the compiler, the other didn't. That's it. That's the whole difference. There is nothing magical about the header files that came with the compiler. It's a plain text file that gets pasted into your cpp file when you include it. The compiler can't tell the difference between one that came with the compiler and one you wrote yourself, because there is no difference.

I want to make functions that c programming doesn't provide.

I think you mean "I want to use assembler in my C code".
http://www.ibiblio.org/gferg/ldp/GCC-Inline-Assembly-HOWTO.html
Last edited on
If you want to use assembly in your code, take a look at "inline assembly".
Ok so even stdio.h was made with c programming. Because theres stuff I can't do like display a butterfly ico instead of a mouse pointer.
Also I'd like to play a sound of any sound type without requiring a dll that isn't compatible with my resources. I'm gonna check out inline assembly.
Also do you guys know whether or not linux assembly is just as sufficient as windows assembly.
Thanks also.
Playing sounds depends on your operating system and hardware. Your operating system will present an API (set of functions you can call) to do such things. It is generally easier to use an intermediate library that will handle all the low-level API handling for you and give you a simple interface.

I note that this is in the Unix/Linux forum. Unix/linux does not use dll files. The equivalent are so files.
Pages: 12