Differences between revisions 2 and 35 (spanning 33 versions)
Revision 2 as of 2008-01-23 13:50:26
Size: 2567
Editor: mpino1301
Comment: Compiling and running "Hello World" on the command line
Revision 35 as of 2011-07-28 22:00:41
Size: 392
Editor: p57B0BAF6
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
= Developing applications under MS-Windows =

This page is mainly written for UNIX developers who want to become familiar with MS development.

First read or skim through the [http://msdn2.microsoft.com/en-us/library/xw1ew2f8(VS.80).aspx Introduction to Visual C++ for UNIX Users] on the [http://msdn2.microsoft.com/en-us/default.aspx Microsoft Developer Network].

(MSDN is Microsoft’s website for software developers. It provides resources that explain how to build software solutions and applications on the Microsoft platform.)


== Compiling and running "Hello World" on the command line ==

Use any editor of your choice to create the following program in a test folder:

{{{
#include <stdio.h>

int main()
{
 printf("Hello world!\n");
}

}}}

Open a DOS box ("Command Prompt"), cd to your test directory, and perform the following steps:

{{{
D:\test>dir
 Volume in drive D is WIN_DAT
 Volume Serial Number is F00B-2B98

 Directory of D:\test

01/23/2008 01:31 PM <DIR> .
01/23/2008 01:31 PM <DIR> ..
01/23/2008 01:31 PM 68 helloworld.c
               1 File(s) 68 bytes
               2 Dir(s) 14,618,644,480 bytes free

D:\test>"C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\vsvars32.bat"
Setting environment for using Microsoft Visual Studio 2005 x86 tools.

D:\test>cl
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.42 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.

usage: cl [ option... ] filename... [ /link linkoption... ]

D:\test>cl helloworld.c
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.42 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.

helloworld.c
Microsoft (R) Incremental Linker Version 8.00.50727.42
Copyright (C) Microsoft Corporation. All rights reserved.

/out:helloworld.exe
helloworld.obj

D:\test>dir
 Volume in drive D is WIN_DAT
 Volume Serial Number is F00B-2B98

 Directory of D:\test

01/23/2008 01:39 PM <DIR> .
01/23/2008 01:39 PM <DIR> ..
01/23/2008 01:31 PM 68 helloworld.c
01/23/2008 01:39 PM 53,248 helloworld.exe
01/23/2008 01:39 PM 612 helloworld.obj
               3 File(s) 53,928 bytes
               2 Dir(s) 14,618,583,040 bytes free

D:\test>helloworld
Hello world!
}}}

Note: If you open a command prompt with the Visual Studio Command Line Prompt from the Start menu, then vsvars32.bat is run for you.
 <a href="http://www.fathermagee.com/">accutane</a> =P <a href="http://www.desteptareabacau.com/tramadol.html">tramadol online lowest price</a> >:-[ <a href="http://www.gravidadezero.org/cialis.html">cheap cialis sale online</a> %)) <a href="http://www.elgolazofm.com/accutane.html">online accutane</a> 8-PP <a href="http://www.marinapoydenot.com/">seroquel</a> xsoc
----
CategoryCategory

CompleteSearch: completesearch/DevelopingUnderWindows (last edited 2011-07-28 22:00:41 by p57B0BAF6)