Jump to content
  • Advertisement
Sign in to follow this  
amonrabrasil

C++

This topic is 5058 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Tell me if Im wrong... When you make a C++ application and compile it.. the compiler creates an "*.obj" file with "Assembly" code in it.. then compiles it.. thats the reason we have pre-compilers like "#include", "#difine",.. right?

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by amonrabrasil
Tell me if Im wrong...

When you make a C++ application and compile it.. the compiler creates an "*.obj" file with "Assembly" code in it.. then compiles it.. thats the reason we have pre-compilers like "#include", "#difine",..


right?


Compilation consists of multiple steps:

1. Preprocessing (not pre-compiling) using #include for example
2. Compilation: transform your code into some binary form (object files)
3. Linking: put together all object files and create an executable

If you write assembler code, you need an assembler to create object code which may be linked together with all the other files.

Share this post


Link to post
Share on other sites
Not exactly. The obj file contains the binary representation of the assembly code the compiler generated; the object file is then linked with other pre-built object files to form the final binary file.

Source > [Compiler] > Obj File

Program.obj--| > [Linker] > Program.exe
Std.obj -----|

Share this post


Link to post
Share on other sites
Quote:
Original post by Manip
.. The obj file contains the binary representation of the assembly code ..


so.. in someway c++ creates an Assembly code?

Share this post


Link to post
Share on other sites
Quote:
Original post by Manip
The obj file contains the binary representation of the assembly code the compiler generated;


Actually the compiler is not required to generate intermediate assymbly code... (although its a good practice)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!