admin 發表於 2015-12-23 08:29:58

The Process of Writing a C++ Program

https://www.ntu.edu.sg/home/ehchua/programming/cpp/images/CompilationProcess.pngStep 1: Write the source codes (.cpp) and header files (.h).
Step 2: Pre-process the source codes according to the preprocessor directives. Preprocessor directives begin with a hash sign (#), e.g., #include and #define. They indicate that certain manipulations (such as including another file or replacement of symbols) are to be performed BEFORE compilation.
Step 3: Compile the pre-processed source codes into object codes (.obj, .o).
Step 4: Link the compiled object codes with other object codes and the library object codes (.lib, .a) to produce the executable code (.exe).
Step 5: Load the executable code into computer memory.
Step 6: Run the executable code, with the input to produce the desried output.
From within the Visual C++ development environment, there are two ways customize the build process:Custom Build Steps
Build EventsBuild events and custom build steps run in the following order along with other build steps:Pre-Build event
Custom build steps on individual files
Proxy generator
MIDL
Resource compiler
The C/C++ compiler
Pre-Link event
Linker or Librarian (as appropriate)
BSCMake
Custom build step on the project
Web deployment tool. The web deployment tool runs as part of a build only if the linker or librarian tools also run. However, you can run the web deployment tool via the Build menu.
Post-Build event




頁: [1]
查看完整版本: The Process of Writing a C++ Program