954,480 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Linker in c

hi ......
im trying to create a simple c compiler.....
how to link the header files to c code?????
can the linking process can be done in assembly language...
or is there a linker for download....
please help....
thanks in advance...

britto
Junior Poster in Training
60 posts since Oct 2008
Reputation Points: 10
Solved Threads: 0
 

>how to link the header files to c code?????
I have a good news for you: no needs to link header files to c codes! The #include directive is replaced by the content of included file - that's all.
Yet another good news: no needs in full scale C compiler to enjoy (or to debug) with header files includes because all include operations are performed by C preprocessor (C compiler per se gets C sources after #include directives processing).

>can the linking process can be done in assembly language...
It depends on your choice: yes, you may substitute header files contents instead of #include directives in assembly language (if it's your compiler implementation language). Moreover, you can do that in any language with input file statements or file i/o libraries.
;)

ArkM
Postaholic
2,001 posts since Jul 2008
Reputation Points: 1,234
Solved Threads: 348
 

The linker doesn't need to know a thing about headers, that's all taken care of long before it gets to that point. A linker should just take your freshly compiled objects and put them together, in the proper system file format.

MosaicFuneral
Posting Virtuoso
1,691 posts since Nov 2008
Reputation Points: 888
Solved Threads: 116
 

i hve a compiled c program (errorless)
is thr a software which can convert c code to exe file.....
i dnt need a c editor.....
like codegenerator to convert c to exe...

britto
Junior Poster in Training
60 posts since Oct 2008
Reputation Points: 10
Solved Threads: 0
 

If you can write C compiler (see OP) then you can write a simplest linker, of course. A linker is much more simpler than a compiler ;)
>is thr a software which can convert c code to exe file...
Of course, there are many C compiler+linker bundles (that's a software which can convert c code to exe file). Most of C compilers have command line versions with integrated and/or separate linkers...

The most interesting counter-question: can you explain what's your true problem? ;)

ArkM
Postaholic
2,001 posts since Jul 2008
Reputation Points: 1,234
Solved Threads: 348
 

time is the problem....
can u name the seperate linkers......

britto
Junior Poster in Training
60 posts since Oct 2008
Reputation Points: 10
Solved Threads: 0
 

the more i read this thread the less i understand it.

jephthah
Posting Maven
2,587 posts since Feb 2008
Reputation Points: 2,143
Solved Threads: 179
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You