468,463 Members | 2,026 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,463 developers. It's quick & easy.

how to create a header file in c++

20
Hi all,

Can u tell me steps by step as how to create header file with my own defined functions and where to place it in TC folder. I tried to save it in INCLUDE but failed terribly.
Oct 22 '06 #1
9 15092
arne
315 Expert 100+
Hi all,

Can u tell me steps by step as how to create header file with my own defined functions and where to place it in TC folder. I tried to save it in INCLUDE but failed terribly.
Did you try to put it in the same directory as your source code file?
(What is TC, btw? Turbo-C?)
Oct 22 '06 #2
Shana
20
Yes TC for Turbo C, I have created header file called "header.h" and saved in include, and then I have created function program and had saved in LIB. After that I wrote a main program which use that function and header file and saved it in bin. Now the prob is when I compile it, I do not get any error however executing the program gives linker error that it does not recognise the function.
Oct 23 '06 #3
arne
315 Expert 100+
Yes TC for Turbo C, I have created header file called "header.h" and saved in include, and then I have created function program and had saved in LIB. After that I wrote a main program which use that function and header file and saved it in bin. Now the prob is when I compile it, I do not get any error however executing the program gives linker error that it does not recognise the function.
I am not at all familiar with Turbo C I have to admit, but:
- there should either be the concept of a "project" to which you add your header files; the IDE will then take care of compiling and linking all the stuff; or
- you have to define an include path to tell the IDE where it can find the headers

These are the typical approaches I would say.

Did you try to store your headers in the same dir as you cpp files? This would be a starting point.
Oct 23 '06 #4
Shana
20
yes i did try it, as far as i know the project thing is in Visual C++. Right now i cannot be online but I will come back tommorow with the enitre code as it is small program just to make sure that a header file can be created and linked with Turbo C++ libraries.
Oct 23 '06 #5
rounak
1
hi! any one of u can teach me how i can make my own header file using turbo c++??????
Feb 14 '07 #6
I think ARNE is correct. You should set the path to the "include" directory.
But here's a catch : If your IDE is supporting other programs, i.e. no linker errors are coming in other programs, then I think you should study the user manuals of TurboC++ get thinks right.
Pawan
Feb 14 '07 #7
actually i want to step by procese how to make header file in tourbo c please sende me the procese
Jul 2 '08 #8
Did you try to put it in the same directory as your source code file?
(What is TC, btw? Turbo-C?)
yes i want to step by step procese how to create my own library header file in torbo c editer
Jul 2 '08 #9
Kid Programmer
176 100+
In you main.cpp file or whatever you named it at the top did you put:
Expand|Select|Wrap|Line Numbers
  1. #include<header.h>
because if you didn't it wont work.
Jul 2 '08 #10

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

6 posts views Thread by Christian Giordano | last post: by
reply views Thread by nail | last post: by
3 posts views Thread by christiang | last post: by
5 posts views Thread by Michael Sperlle | last post: by
15 posts views Thread by lxyone | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by kmladenovski | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.