hai guys..just now before i download one header file for c.but i do't know how to use that,..tat header file is needed for another compiling of program....any body know pls tell.(in windows XP)
Header files contain declarations that may be needed in more than one implementation file (.c or .cpp). Rather than hard-code the declaration in every file, they are put in a header file.
Header files are just text files. By tradition, in C they have a .h extension and in C++ they have no extension. However, this is optional and not checked by the proprocessor.
Just:
#include <MyHeader.h>
or
#include "MyHeader.h"
The <> format says the header file is located along a predefined path. Known as "the usual places". You define these paths by going to your project's properties and looking at the ones for the preprocessor. One of thise properties is "additional include directories".
The " " format says the header file is located in the same folder as the implementation file. If it's not, then the usual places are searched sames is if you had used the <> format.
7 2701
Header files contain declarations that may be needed in more than one implementation file (.c or .cpp). Rather than hard-code the declaration in every file, they are put in a header file.
Header files are just text files. By tradition, in C they have a .h extension and in C++ they have no extension. However, this is optional and not checked by the proprocessor.
Just:
#include <MyHeader.h>
or
#include "MyHeader.h"
The <> format says the header file is located along a predefined path. Known as "the usual places". You define these paths by going to your project's properties and looking at the ones for the preprocessor. One of thise properties is "additional include directories".
The " " format says the header file is located in the same folder as the implementation file. If it's not, then the usual places are searched sames is if you had used the <> format.
@rampraveen
Header files are not needed to execute a program; they are only needed to compile a program.
k.but to compile that header file is need.when i execute that program it wants that header fille.how can i use the new header file..pls tell
k.how can i use the new header file.......tat's my doubt..
What is the "new header file"? Is is different from the on eyou started with?
@rampraveen
Please clarify ... do you get an error when you compile (build) your program or when you execute it? You keep saying the problem occurs when you execute your program, but that doesn't make any sense if we're talking about C preprocessor header files. Perhaps we're talking about something else.
The header file you compiled basically tells the compiler -> "I'm going to be using these classes and functions. Don't worry about it now; I'll provide them later".
When you run the program, the program now says "Where is the compiled code for these classes and functions you told me about?"
You probably need to provide the compiled object code .o, for these headers that you used, when you are running your file.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: tyousaf |
last post by:
Hi
i am new to mysql and mysql++, i have installed mysql server, it is
running fine. i also installed "mysql++-1.7.9gcc3.2-2.i386.rpm" (i
have gcc 3.3) , first of all as the readme file says to do...
|
by: Steven T. Hatton |
last post by:
Is there anything that gives a good description of how source code is
converted into a translation unit, then object code, and then linked. I'm
particularly interested in understanding why putting...
|
by: Al |
last post by:
I'm still trying to do this but it never worked!
In a .cpp file, I write the code, and at the beginning, I write:
#ifndef MYLIST_H
#define MYLIST_H
....to end:
#endif
What's wrong with it for...
|
by: Barrie |
last post by:
I'm having a quite complicate situation, and it doesn't want to
compile.
The situation is as follows:
I have three classes, let's call them A, B and C. They each have a .h
and a .cpp file.
All...
|
by: ehabaziz2001 |
last post by:
How can I compile that program under Solaris 8 using gcc and what
header files will be used ?
main()
{
/* Define default values: */
int n = 0;
float x = 0.0;
|
by: WebSnozz |
last post by:
I have an application written in C that does a lot of low level stuff.
It does a lot of things like casting from void*'s. I want to create a
new GUI for it in either C# or MC++, but reuse the...
|
by: stevenruiz |
last post by:
Hi Everyone,
The problem that I have involves compiling two files. I've
received this error before and I understood that I was missing the
correct library. The error is as follows:
ld:...
|
by: jois.de.vivre |
last post by:
I'm trying to include a C header file from an external library in my C+
+ program but when I compile I get the following error:
error: expected unqualified-id before 'private'
error: abstract...
|
by: Gaijinco |
last post by:
I'm having a weird error compiling a multiple file project:
I have three files:
tortuga.h where I have declared 5 global variables and prototypes for
some functions.
tortuga.cpp where I...
|
by: Albert |
last post by:
Hi
I'm using the lcc compiler for win32. I tried compiling a program but
there's an error stating: "cpp: Can't open input file clrscr()"
I don't get it - I've included <tcconio.h>. (strange why...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |