473,794 Members | 2,765 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2058

Lindon <li************ @yahoo.com> wrote in message
news:34******** *************** ***@posting.goo gle.com...
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 "preprocess or" which handles
the #if, #define and etc. statements (& directives). The output
is a "translatio n 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.l earn.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
6580
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 FRICKIN' COOL!!! ***MAN*** that would save me a buttload of work and make my life sooooo much easier!" As opposed to minor differences of this feature here, that feature there. Variations on style are of no interest to me. I'm coming at this from a...
10
3859
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 know which version of GCC introduced stdint.h (and thereby uintptr_t and intptr_t)? I'd like to get the conditionals right. -Scott David Daniels Scott.Daniels@Acm.Org
92
6544
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? cheers, reed
20
2569
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 following, delimited by //////: ////////////////pose.h #ifndef pose_h #define pose_h #include "point.h"
121
10185
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 support IDEs are DreamWeaver 8 and Zend PHP Studio. DreamWeaver provides full support for Unicode. However, DreamWeaver is a web editor rather than a PHP IDE. It only supports basic IntelliSense (or code completion) and doesn't have anything...
5
1216
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
3222
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
1745
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 update it, so I first added a ".old" suffix to the MyPage.aspx, MyProject.dll, and global.asax files on the production server so I had a backup copy of the original files in case something went wrong. Indeed, something did go wrong when I installed...
9
2218
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 define/implement them in cpp?
0
9671
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9518
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10433
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10212
jinu1996
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10000
tracyyun
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6777
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4112
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3720
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2919
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.