nfoTools

T060101d: Hello, What’s Happening Here?

nfoTools tools>t060101>d index.html 0.0.5 2023-06-25
nfotools Work in Progress Hard Hat Area

1. Overall Operation

The overall objective is to convert single-file program, hello.c, into a program, hello.exe, that can be run directly on the computer. There is a simple pattern using the command-line interface that is initiated along with the Developer Command Prompt’s initialization of a build tools environment.

The diagrammatic view, below, parallels the observed command-line operation in Getting to “Hello”. This is a general pattern, using the specific example of hello.c for clarity.

Overall Operation

Two command-line operations are performed.

KEY IDEA hello.exe is repeatedly-usable, while having to be compiled only once. The program can be used by others without building it or even knowing how.

With the simple “>CL hello.c” command, The hello.exe program is automatically produced as a Command-Line Application (CLA). This is the default behavior in the absence of any additional parameters in the command. The resulting program is completely self-contained and structured for operation by command prompt.

EXPERIMENT. From the File Explorer, double-click on the hello.exe entry. A command-line interface will open automatically, the program will run, and the command-line interface will exit. That can happen so rapidly that it might not be observed at all, as if nothing happened.

For now, simply open a command prompt first. Then operate the program with a command. Later, there will be ways to have operation be accomplished more directly and smoothly.

The Build Tools program, CL/exe operates as a precision multi-tool. It has many options and stages of operation. With the simple command-line for “Getting to Hello,” much happens visibly and also under the covers.

An automatic pattern is separation of compiling into two stages: compile and then link. The compile stage converts the source code to a file consisting of (linkable) machine code for that source. The link stage combines modules of such code from many sources, including Standard C libraries, into a single executable, such as hello.exe. The general idea is reflected in the simplified diagram.

Compile+Link


Discussion about nfoTools is welcome at the Discussion section. Improvements and removal of defects in this particular documentation can be reported and addressed in the Issues section. There are also relevant projects from time to time.