Connecting Tech Pros Worldwide Help | Site Map
Reply
 
LinkBack Thread Tools Search this Thread
  #1  
Old October 22nd, 2006, 11:20 AM
Newbie
 
Join Date: Oct 2006
Posts: 20
Default how to create a header file in c++

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.
Reply
  #2  
Old October 22nd, 2006, 01:19 PM
arne's Avatar
Expert
 
Join Date: Oct 2006
Posts: 307
Default

Quote:
Originally Posted by Shana
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?)
Reply
  #3  
Old October 23rd, 2006, 06:02 AM
Newbie
 
Join Date: Oct 2006
Posts: 20
Default

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.
Reply
  #4  
Old October 23rd, 2006, 08:17 AM
arne's Avatar
Expert
 
Join Date: Oct 2006
Posts: 307
Default

Quote:
Originally Posted by Shana
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.
Reply
  #5  
Old October 23rd, 2006, 10:49 AM
Newbie
 
Join Date: Oct 2006
Posts: 20
Default

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.
Reply
  #6  
Old February 14th, 2007, 06:08 AM
Newbie
 
Join Date: Feb 2007
Posts: 1
Default

hi! any one of u can teach me how i can make my own header file using turbo c++??????
Reply
  #7  
Old February 14th, 2007, 07:49 AM
Member
 
Join Date: Feb 2007
Posts: 52
Default

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
Reply
  #8  
Old July 2nd, 2008, 05:46 PM
Newbie
 
Join Date: Jul 2008
Posts: 2
Default

actually i want to step by procese how to make header file in tourbo c please sende me the procese
Reply
  #9  
Old July 2nd, 2008, 06:05 PM
Newbie
 
Join Date: Jul 2008
Posts: 2
Default

Quote:
Originally Posted by arne
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
Reply
  #10  
Old July 2nd, 2008, 07:16 PM
Familiar Sight
 
Join Date: Mar 2008
Age: 11
Posts: 174
Default

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.
Reply
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 204,687 network members.
Post your question now . . .
It's fast and it's free

Popular Articles