Is there way I could make my own header files?

Pages: 12
May 4, 2012 at 10:06am
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.
May 4, 2012 at 10:20am
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.
May 4, 2012 at 10:34am
I meant I want to make a header file that is included with greater then and less then symbols. Have any idea about that?
May 4, 2012 at 10:37am
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 May 4, 2012 at 10:38am
May 4, 2012 at 10:57am
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.
May 4, 2012 at 11:00am
Every one tells me how to make normal header files when I ask that question.
May 4, 2012 at 11:02am
What is a built in header file?
May 4, 2012 at 11:03am
stdio.h?
May 4, 2012 at 11:03am
I want to make functions that c programming doesn't provide.
May 4, 2012 at 11:07am
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 May 4, 2012 at 11:13am
May 4, 2012 at 11:13am
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 May 4, 2012 at 11:17am
May 4, 2012 at 11:23am
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.
May 4, 2012 at 11:24am
I mean if there is a method or a html file on the subject I really want to know.
Last edited on May 4, 2012 at 11:24am
May 4, 2012 at 11:31am
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 May 4, 2012 at 11:36am
May 4, 2012 at 11:35am
If you want to use assembly in your code, take a look at "inline assembly".
May 4, 2012 at 11:40am
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.
May 4, 2012 at 11:44am
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.
May 4, 2012 at 11:44am
Also do you guys know whether or not linux assembly is just as sufficient as windows assembly.
May 4, 2012 at 11:45am
Thanks also.
May 4, 2012 at 11:46am
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