Compiling & Execution
When we have written a program we Start Debugging to execute the program. I wish to know when does the compiling begin and end, and when does the execution begin and end. Because book is separating compiling and execution. I attach the book page.
Posted Feb 7, 2012, 9:20 PM
Sam HobbsPosted Feb 7, 2012, 9:10 PM
Maha, what kind of project is it? I assume it is a console project. Did you add a reference for System.Windows.Forms? Probably not.
Note that this is a new question so a new thread should have been created for it.
Prime bPosted Feb 7, 2012, 9:05 PM
Posted Feb 7, 2012, 8:58 PM
The type or namespace name 'Windows' does not exist in the namespace 'System' (are you missing an assembly reference?)
using System;
using System.Windows.Forms;
namespace fig9_1
{
class MessageBoxl
{
static void Main(string[] args)
{
MessageBox.Show("Hello");
}
}
}
VulpesPosted Jan 5, 2012, 9:38 AM
Posted Jan 5, 2012, 7:32 AM
Sam HobbsPosted Jan 5, 2012, 12:55 AM
I think Visual Studio makes the difference crystal clear. You must build a project, then you execute it. The build does nothing unless something has changed that is a relevant part of the project; mainly source code. A build processes the files that are listed as input for the project using whatever tools such as the compiler that are designated for processing each type of file. The result is an executable file. The executable file can be executed many times, even a million times, without another build.
Languages such as C# and Java normally create an executable that is not directly executable but that use a virtual machine of some type. So what Vulpes says about intermediate language (IL) and metadata is true for languages such as C# and Java.
Before C# and Java existed, normally source code files would first be compiled and the output would be called object files. Then a linker would process all object files that need to go into a single executable.
Sean StewartPosted Jan 4, 2012, 11:02 PM
http://stackoverflow.com/questions/6312452/c-sharp-online-compiling-and-execution-security-issues
VulpesPosted Jan 4, 2012, 6:18 PM