473,378 Members | 1,620 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

what is there to know about compiling?

Until now I've been programming straight console apps, and all I've
been doing to compile is a simple 'gcc file1.cpp file2.cpp ....'.
What more is there to know about the compiler? I'd like to know
exactly what happens during each step. Is the compilation of dll's
(and corresponding libs on *nix) possible with only the compiler and
no platform specifc libraries (like windows.h)? What am I missing out
on?
thanks,
lin
Jul 19 '05 #1
2 2033

Lindon <li************@yahoo.com> wrote in message
news:34**************************@posting.google.c om...
Until now I've been programming straight console apps, and all I've
been doing to compile is a simple 'gcc file1.cpp file2.cpp ....'.
What more is there to know about the compiler?
Quite a bit. That's why it has so much documentation,
mailing lists, newsgroups, etc.
I'd like to know
exactly what happens during each step.
Consult the gnu web site, or some of the other multiple
support resources for it.
Is the compilation of dll's
(and corresponding libs on *nix) possible with only the compiler and
no platform specifc libraries (like windows.h)? What am I missing out
on?


What you're missing is that the installation, configuration,
and operation of a compiler is outside the domain of the language.
Here, only the language is discussed.

Your query is not topical here.

-Mike

Jul 19 '05 #2
Lindon wrote:
Until now I've been programming straight console apps, and all I've
been doing to compile is a simple 'gcc file1.cpp file2.cpp ....'.
What more is there to know about the compiler? I'd like to know
exactly what happens during each step. Is the compilation of dll's
(and corresponding libs on *nix) possible with only the compiler and
no platform specifc libraries (like windows.h)? What am I missing out
on?
thanks,
lin


I suggest you search the web or get some books on compiler theory.
Compiler theory is to vast a subject to describe in a single post.
Many universities offer year-long courses on the subject.

Here is a brief overview:
1. A source file is processed by the "preprocessor" which handles
the #if, #define and etc. statements (& directives). The output
is a "translation unit". The Preprocessor may also extract out
comments.

2. The translation unit is then parsed into tokens.
(See subject of "lexical analysis" using your favorite search
engine).

3. The tokens are then processed according to a "grammar", which
is a set of rules for the language.

4. The parser may create an interim or assembly language. This
interim language is then passed to another processor which
translates the language into an "object" format. The object
format contains the binary machine code (executable code)
usually in a relative format along with some symbolic info.

5. A linking or binding step is performed next. The linker
combines these object files, and resolves undefined
references and produces an executable program.

6. Libraries are created by coagulating (coercing?), collecting
or combining many object files into a single file. The
librarian may resolve any undefined references.

The above steps may be combined into one step or not at all.

Dynamic Link Libraries and Shared Libraries _are_ platform
specific. These are units of code that are loaded on demand
during run-time by the operating system as opposed to
static libraries which are loaded during the build process.

Compiler theory and shared / dynamic libraries are not
discussed (in depth) in this newsgroup. For further
information, search newsgroups about your compiler or
operating system and also search the web.

--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:
http://www.josuttis.com -- C++ STL Library book

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

54
by: Brandon J. Van Every | last post by:
I'm realizing I didn't frame my question well. What's ***TOTALLY COMPELLING*** about Ruby over Python? What makes you jump up in your chair and scream "Wow! Ruby has *that*? That is SO...
10
by: Scott David Daniels | last post by:
I am trying to figure out how to get 2.4a2 to build a python extension. GCC 2.2.95 does not have a stdint.h, but 3.2.3 does. These two are the only gcc versions I have on my box. Does anyone...
92
by: Reed L. O'Brien | last post by:
I see rotor was removed for 2.4 and the docs say use an AES module provided separately... Is there a standard module that works alike or an AES module that works alike but with better encryption?...
20
by: Sam | last post by:
Hi I'm learning to code with C++ and wrote some very simple code. I think it's consistent with every rule but always got compiling errors that I don't understand. The code include 5 files as...
121
by: typingcat | last post by:
First of all, I'm an Asian and I need to input Japanese, Korean and so on. I've tried many PHP IDEs today, but almost non of them supported Unicode (UTF-8) file. I've found that the only Unicode...
5
by: Christopher Benson-Manica | last post by:
Can you correctly identify the output of the following program, without compiling it? #include <stdio.h> int main( void ) { int a=1; int b=0; int foo=10+a?1:0+b?1:0;
40
by: vishnu | last post by:
Hi friend, i have a problem in my program what is the use of static function in C lang? plz help me
7
by: Altemir | last post by:
SOME BACKGROUND: I am new to ASP.NET, but somehow managed to install a perfectly working ..aspx page on our production server that I compiled in Visual Studio. However, I recently needed to...
9
by: xz | last post by:
What sense do h files make in c/cpp? I never thought about this question before. Does the existence of h files make sense at all? Why do we need to declare functions in h files and...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
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 using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.