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.