Regarding the conjecture and test of VC compilation

zhaozj2021-02-16  46

Conjecture about the trial of VC compiled: JIURL Home: http://jiurl.yeah.net/ Date: 2003-5-4

Today, I have some ideas when I look at the makefile file exported from the console program. In order to verify these ideas, he did some tests. My environment is Win2K, VC6. First briefly introduce how the program compiles link. After the program is written, we compile and link to generate executables. At this time, in order to complete compilation and link, the compiler needs to know a lot of information. For example, which is the file to be compiled, which compile options are compiled, and when compiling, where is the output, what is the name of the output file, and so on. Makefile is one of the ways to save this information, compile time program nmake, according to the information in the Makefile, performing the link with the corresponding option, and finally generates an executable. The compiler of the VC is Cl.exe, the linker is link.exe. The procedures for the VC compilation links mentioned herein are in the directory ... / Microsoft Visual Studio / VC98 / BIN / Under. The whole process is as follows. When I read this console program, I suddenly suspected that the compilation of console, SDK, MFC, etc. was done by performing external nmake.exe. If it is what I guess, if I select Rebuild ALL in the VC's integrated environment, the VC will execute nmake.exe files, then nmake.exe must exist, otherwise compile whether it will fail. So, I changed the NMAKE.EXE file with this file. To test, whether the Console, SDK, and MFC programs of VC6 are called NMAKE to complete compilation. The result is very disappointed, there is no nmake.exe, which can be compiled like this Console program. This shows that VC6 is not compiled by performing NMAKE. It may be some of the functions to call the inside to process various compiled parameters and paths, and then call compilers and link programs to complete compilation. But think about it again, even there is no Makefile file. Will not guide compilation through nmake. So what is the case of using the Makefile program (called Project more accurate)? So I found a program using Makefile, I found ping in the example of MSDN, which is used by Makefile. This time, if there is no nmake.exe, it will not be compiled. The following error 'nmake' is not internal or external command, nor is it a running program or batch file. Error Executing D: /winnt/system32/cmd.exe. It can be seen that the use of Makefile is indeed the contents of the makefile by nmake.exe analysis. Summarize, use the Win32 Console Application (Console), Win32 Application (SDK), MFC Appwizard (MFC), which is built in VC NEW-> Project, compiled does not pass NMAKE. The compiler of the Makefile will be compiled with the corresponding makefile file through NMAKE. By the way, there is no Makefile engineering, where is their compilation, and where is the compile option? This is what I know itself. They can see the DSP file in the DSP file in the project directory, such as notepad, open the DSP file. You can also open the DSW file to see. Finally, I did this two tests and renamed CL.exe. The results were compiled. The mistake is as follows.

转载请注明原文地址:https://www.9cbs.com/read-26152.html

New Post(0)