linking problem

V

vaib

hi all ,
i am facing a funny problem in C . i am using turbo's compiler - the
16 bit compiler for dos . i made a file maximum.h which contains a
function declaration , and includes files such as stdio.h . i then
made a maximum.c which contains the definition of the function
declared in maximum.h . maximum.c also includes maximum.h . then i
made a main.c which includes maximum.h and calls the function declared
in maximum.h . all the 3 files compile well but when i run main.c , it
gives me a linker error that it cannot find the function's obj . i've
tried everything . i put all in bin n compiled . i put all under one
folder n compile but nothing seems to work . how do i make the linker
aware of my maximum.obj ??
 
A

Antoninus Twink

i am facing a funny problem in C . i am using turbo's compiler - the
16 bit compiler for dos .

A popular choice around here! Heathfield's favorite compiler too, if I'm
not mistaken - you can't say that clc doesn't cultivate a certain
eccentricity.
i made a file maximum.h which contains a function declaration , and
includes files such as stdio.h . i then made a maximum.c which
contains the definition of the function declared in maximum.h .
maximum.c also includes maximum.h . then i made a main.c which
includes maximum.h and calls the function declared in maximum.h . all
the 3 files compile well but when i run main.c , it gives me a linker
error that it cannot find the function's obj . i've tried everything .
i put all in bin n compiled . i put all under one folder n compile but
nothing seems to work . how do i make the linker aware of my
maximum.obj ??

Did you tell the linker than maximum.obj exists? Normally you need to
include it as one of the arguments on the command line - check your
linker's documentation.
 
S

santosh

vaib said:
hi all ,
i am facing a funny problem in C . i am using turbo's compiler - the
16 bit compiler for dos . i made a file maximum.h which contains a
function declaration , and includes files such as stdio.h . i then
made a maximum.c which contains the definition of the function
declared in maximum.h . maximum.c also includes maximum.h . then i
made a main.c which includes maximum.h and calls the function declared
in maximum.h . all the 3 files compile well but when i run main.c , it
gives me a linker error that it cannot find the function's obj . i've
tried everything . i put all in bin n compiled . i put all under one
folder n compile but nothing seems to work . how do i make the linker
aware of my maximum.obj ??

Include it in the command line during compilation or during linking if
your perform the latter separately. See TC's documentation.
 
N

Noob

Antoninus said:
A popular choice around here! Heathfield's favorite compiler too,
if I'm not mistaken - you can't say that clc doesn't cultivate a
certain eccentricity.

You, sir, truly have no life.
 
V

vaib

A popular choice around here! Heathfield's favorite compiler too, if I'm
not mistaken - you can't say that clc doesn't cultivate a certain
eccentricity.


Did you tell the linker than maximum.obj exists? Normally you need to
include it as one of the arguments on the command line - check your
linker's documentation.

no i didn't tell the linker about it . thats why its not able to find
or link it . where do i get the required documentation from ??
 
S

santosh

vaib said:
no i didn't tell the linker about it . thats why its not able to find
or link it . where do i get the required documentation from ??

Turbo C has quite a bit of help included as default. First read the
README file by either invoking the readme.com utility or directly
opening the readme file in a editor like edit. Then invoke the
THELP.COM utility for the main documentation. The help for using
THELP.COM is found in the THELP.DOC file. Finally there is online help
within the Turbo C IDE available by pressing F1 at any time. Also
invoking tcc without any command options will get it to print some
terse usage information onto the screen.
 
F

Flash Gordon

vaib wrote, On 01/05/08 18:02:
no i didn't tell the linker about it . thats why its not able to find
or link it . where do i get the required documentation from ??

Probably the same place you get your linker from. For me this varies
between a DVD provided by MS, in man page provided by IBM, an info
document provided as part of a Linux distribution and a few other
places. If you need further direction on your specific tools ask on a
group/mailing-list/web-forum dedicated to your compiler, since there are
literally thousands of different compilers and linkers and they work
differently.
 

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,472
Messages
2,571,834
Members
48,802
Latest member
shadowoftheunknown
Top