Please explain about c

H

honey

I have downloaded c api that have many h file and c file and one main
file.
I use turbo c compiler.
So I put header files under C:\tc\include
and I put c files under C:\tc\bin
I also declare header file in main program.
But I get the linker error message.
what is the problem?
Is it right to put c file in that folder.
Does c compiler automatically link to c files?
Please help me.

I will be waiting for your reply.
My other mail is (e-mail address removed).
Sometimes I cannot open gmail.
 
U

Ulrich Eckhardt

honey said:
I have downloaded c api that have many h file and c file and one main
file.
I use turbo c compiler.
So I put header files under C:\tc\include
and I put c files under C:\tc\bin

Normally, compiled programs are stored under 'bin', not C source files.
Also, it seems those directories belong to TC, so you shouldn't mess with
their content at all.
I also declare header file in main program.
But I get the linker error message.

Which one exactly?
Please help me.

I suggest going to http://accu.org and picking a good book on beginners' C
coding from the reviews section.
I will be waiting for your reply.
My other mail is (e-mail address removed).
Sometimes I cannot open gmail.

Doesn't matter. You are on the Usenet here, and you will not get any
replies to your mailaddresses anyway. The idea is that in public
newsgroups everybody benefits from the discussions - after all, someone
might have the same problems as you do. Please also make sure that you
read a bit about the so-called netiquette for newsgroups.

cheers

Uli
 
J

John Bode

honey said:
I have downloaded c api that have many h file and c file and one main
file.
I use turbo c compiler.
So I put header files under C:\tc\include
and I put c files under C:\tc\bin

Did the instructions that came with the API tell you to do that? If
not, why did you do that?
I also declare header file in main program.
But I get the linker error message.

What is the error message?
what is the problem?
Is it right to put c file in that folder.
Does c compiler automatically link to c files?
Please help me.

You need to give us more information. Which API did you download?
What's it for?
 
S

santosh

honey said:
I have downloaded c api that have many h file and c file and one main
file.
I use turbo c compiler.
< rest snipped >

Specific C implementations like Turbo C are off-topic here. Why not try
on one of the Borland groups?
 
K

Keith Thompson

honey said:
I have downloaded c api that have many h file and c file and one main
file.
I use turbo c compiler.
So I put header files under C:\tc\include
and I put c files under C:\tc\bin
I also declare header file in main program.
But I get the linker error message.
what is the problem?
Is it right to put c file in that folder.
Does c compiler automatically link to c files?
Please help me.

Different C compilers behave differently; the only thing they all have
in common is that they compile C code.

I have no idea how to import existing C code (your .h and .c files)
into Turbo C. Almost certainly the Turbo C documentation will tell
you exactly how to do this. Read it. If that doesn't work, try a
Google search. If that doesn't work, consider posting to a newsgroup
that's appropriate for your system, perhaps a Windows programming
group.
 
U

Ulrich Eckhardt

santosh said:
< rest snipped >

Specific C implementations like Turbo C are off-topic here. Why not try
on one of the Borland groups?

Why not give someone a hand that obviously has far from enough clue to
decide whether some topic is exactly on topic or off topic? Seriously, I
also redirect people when there are more suitable groups, but with someone
that obviously is a beginner and who's problem isn't even clear (yes, read
the posting and you see that it's not even clear what exactly their
problem is!) this makes little sense.

Uli
 
C

CBFalconer

Ulrich said:
Why not give someone a hand that obviously has far from enough
clue to decide whether some topic is exactly on topic or off
topic? Seriously, I also redirect people when there are more
suitable groups, but with someone that obviously is a beginner
and who's problem isn't even clear (yes, read the posting and
you see that it's not even clear what exactly their problem is!)
this makes little sense.

His questions were all about linking and file locations. None of
that is germane to the language. He is also using an obsolete (but
usable) system, so any of our memories of it are suspect. He was
given a hand - a place to look for information.

--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
More details at: <http://cfaj.freeshell.org/google/>
Also see <http://www.safalra.com/special/googlegroupsreply/>
 
K

Keith Thompson

Ulrich Eckhardt said:
Why not give someone a hand that obviously has far from enough clue to
decide whether some topic is exactly on topic or off topic? Seriously, I
also redirect people when there are more suitable groups, but with someone
that obviously is a beginner and who's problem isn't even clear (yes, read
the posting and you see that it's not even clear what exactly their
problem is!) this makes little sense.

What better help could we have given him? I, for one, have no clue
how to solve his problem; any direct advice I could have offered would
have been useless.

He's having trouble with the Turbo C compiler, not with the C
programming language. Redirecting him to some place where people
actually know how to use the Turbo C compiler is absolutely the best
help we can give him. (Flaming him for posting something off-topic
would have been unhelpful, but I don't think anyone did that.)
 
H

honey

I am very sorry for my stupid question.
I have no experience in programming and I even don't know which group
should I choose.
Besides I am weak in English so I can't express clearly what I mean.

The question I would like to ask is "how to link header file (.h file)
and source file (.c file) in c"
I downloaded many .h files and .c files. I have noticed that the
functions are declared in .h files and defined in .c files. I don't
know how to link them in main program.

This may be a stupid question and off-topic. If so, I am really sorry
and please forgive me.

Thank you very much for your time.(especially Uli for your kindness.)

I have never used forum before.
I will never forget this experience.
 
S

santosh

honey said:
I am very sorry for my stupid question.
I have no experience in programming and I even don't know which group
should I choose.
Besides I am weak in English so I can't express clearly what I mean.

Quite all right. In future though, please quote the relevant portions
of the post to which you're replying. Some newsreaders do not show
previous articles in a nice manner and most news servers delete older
articles after a period of time. Thus try to make the context of your
posts as self-contained as possible. If you're using Google Groups,
click the 'show options' link at the top of the post to which you're
replying and then click the 'reply' link to post.

Please make sure to read the content at the following links:
<http://cfaj.freeshell.org/google/>
The question I would like to ask is "how to link header file (.h file)
and source file (.c file) in c"
I downloaded many .h files and .c files. I have noticed that the
functions are declared in .h files and defined in .c files. I don't
know how to link them in main program.

The .h files are called as 'header files' and they typically contain
data declarations and function prototypes among other things. They
present the 'interface' to the functions implemented in the .c files.
To use a function in a .c file, you include the relevant .h file into
your source file with an INCLUDE statement.

Please read the following good online book to learn the basics of C and
it's associated terminology.

http://publications.gbdirect.co.uk/c_book/

Alternatively buy a good C text like 'The C Programming Language' 2nd
Edition by Kernighan and Ritchie.
 
M

Mark McIntyre

The question I would like to ask is "how to link header file (.h file)
and source file (.c file) in c"
I downloaded many .h files and .c files. I have noticed that the
functions are declared in .h files and defined in .c files. I don't
know how to link them in main program.

This is a question about how to use your compiler, and not actually
anything to do with the C language.

You need to read the compiler documentation, since each one is
slightly different. You could also ask in newsgroups specialising in
your compiler.
Mark McIntyre
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,176
Messages
2,570,947
Members
47,498
Latest member
log5Sshell/alfa5

Latest Threads

Top