# Compilers

Compiling with free legal tools

## Why buy the VS NET trial if i can compile free?

Simple. You get the whole package with SDK's on DVD and dont have to download\
nor do you have a ton of install packages taking up HDD space

Can find MSVS Pre-reqs [here](http://search.microsoft.com/search/results.aspx?st=b\&na=88\&View=en-US\&qu=Microsoft+Visual+Studio+.NET+2003+Pre+requisites).

## Buy Visual Studio .NET 2005 trial

[VS Net 2003](http://msdn.microsoft.com/vstudio/productinfo/trial/default.aspx) The above link is a trial of VS NET 2003 it's only 10 dollars\
\[edited the above link, it went to the 2003 trial version]

<http://msdn.microsoft.com/getthebetas/> This link goes to the page for Non-Subscribers to MSDN. Get Visual Studio 2005 Beta 2

<https://www.getthebetas.com/profile.aspx> This link takes you to the order form to get Visual Studio 2005 Beta 2 on a DVD or CD. $4.69U.S.

## Free and Legal compiling environment

Required OS Win2k Win3k Server or WinXP\
First download this application.\
[Compiler and Linker: Microsoft Visual C++ Toolkit 2003](http://msdn.microsoft.com/visualc/vctoolkit2003/)\
[VC Toolkit Download](http://download.microsoft.com/download/3/9/b/39bac755-0a1e-4d0b-b72c-3a158b7444c4/VCToolkitSetup.exe)

## The WIn3k Core SDK

Ok now you will need to supplement it with the Core SDK to obtain the Headers and Libraries\
With out these you cant compile any windows32 apps.\
I will list them by cab file so you can download better if your on dialup or have\
bandwidth limits, or time limits.\
You will need ALL the files listed though!\
Header and Library: Core Platform SDK from Microsoft SDK Update\
DOWNLOAD 01/15: [SDK CAB1](http://download.microsoft.com/download/platformsdk/sdk/update/win98mexp/en-us/3790.0/FULL/PSDK-FULL.1.cab)\
DOWNLOAD 02/15: [SDK CAB2](http://download.microsoft.com/download/platformsdk/sdk/update/win98mexp/en-us/3790.0/FULL/PSDK-FULL.2.cab)\
DOWNLOAD 03/15: [SDK CAB3](http://download.microsoft.com/download/platformsdk/sdk/update/win98mexp/en-us/3790.0/FULL/PSDK-FULL.3.cab)\
DOWNLOAD 04/15: [SDK CAB4](http://download.microsoft.com/download/platformsdk/sdk/update/win98mexp/en-us/3790.0/FULL/PSDK-FULL.4.cab)\
DOWNLOAD 05/15: [SDK CAB5](http://download.microsoft.com/download/platformsdk/sdk/update/win98mexp/en-us/3790.0/FULL/PSDK-FULL.5.cab)\
DOWNLOAD 06/15: [SDK CAB6](http://download.microsoft.com/download/platformsdk/sdk/update/win98mexp/en-us/3790.0/FULL/PSDK-FULL.6.cab)\
DOWNLOAD 07/15: [SDK CAB7](http://download.microsoft.com/download/platformsdk/sdk/update/win98mexp/en-us/3790.0/FULL/PSDK-FULL.7.cab)\
DOWNLOAD 08/15: [SDK CAB8](http://download.microsoft.com/download/platformsdk/sdk/update/win98mexp/en-us/3790.0/FULL/PSDK-FULL.8.cab)\
DOWNLOAD 09/15: [SDK CAB9](http://download.microsoft.com/download/platformsdk/sdk/update/win98mexp/en-us/3790.0/FULL/PSDK-FULL.9.cab)\
DOWNLOAD10/15: [SDK CAB10](http://download.microsoft.com/download/platformsdk/sdk/update/win98mexp/en-us/3790.0/FULL/PSDK-FULL.10.cab)\
DOWNLOAD11/15: [SDK CAB11](http://download.microsoft.com/download/platformsdk/sdk/update/win98mexp/en-us/3790.0/FULL/PSDK-FULL.11.cab)\
DOWNLOAD12/15: [SDK CAB12](http://download.microsoft.com/download/platformsdk/sdk/update/win98mexp/en-us/3790.0/FULL/PSDK-FULL.12.cab)\
DOWNLOAD13/15: [SDK CAB13](http://download.microsoft.com/download/platformsdk/sdk/update/win98mexp/en-us/3790.0/FULL/PSDK-FULL.13.cab)\
DOWNLOAD14/15: [Install Batch File](http://download.microsoft.com/download/platformsdk/sdk/update/win98mexp/en-us/3790.0/FULL/PSDK-FULL.bat)\
DOWNLOAD15/15: [Extractor Executable](http://download.microsoft.com/download/platformsdk/sdk/update/win98mexp/en-us/3790.0/FULL/Extract.exe)

## Platform SDK

This is the WindowsXP SP2 SDK. WHile you could probably compile with this SDK alone, i dont reccomend skipping the win3k core sdk above. No harm in trying with this SDK only.

DOWNLOAD 1/10 [XPSP2 SDK CAB1](http://download.microsoft.com/download/platformsdk/sdk/update/WIN98MeXP/EN-US/2600.2180/FULL/PSDK-FULL.1.cab)\
DOWNLOAD 2/10 [XPSP2 SDK CAB2](http://download.microsoft.com/download/platformsdk/sdk/update/WIN98MeXP/EN-US/2600.2180/FULL/PSDK-FULL.2.cab)\
DOWNLOAD 3/10 [XPSP2 SDK CAB3](http://download.microsoft.com/download/platformsdk/sdk/update/WIN98MeXP/EN-US/2600.2180/FULL/PSDK-FULL.3.cab)\
DOWNLOAD 4/10 [XPSP2 SDK CAB4](http://download.microsoft.com/download/platformsdk/sdk/update/WIN98MeXP/EN-US/2600.2180/FULL/PSDK-FULL.4.cab)\
DOWNLOAD 5/10 [XPSP2 SDK CAB5](http://download.microsoft.com/download/platformsdk/sdk/update/WIN98MeXP/EN-US/2600.2180/FULL/PSDK-FULL.5.cab)\
DOWNLOAD 6/10 [XPSP2 SDK CAB6](http://download.microsoft.com/download/platformsdk/sdk/update/WIN98MeXP/EN-US/2600.2180/FULL/PSDK-FULL.6.cab)\
DOWNLOAD 7/10 [XPSP2 SDK CAB7](http://download.microsoft.com/download/platformsdk/sdk/update/WIN98MeXP/EN-US/2600.2180/FULL/PSDK-FULL.7.cab)\
DOWNLOAD 8/10 [XPSP2 SDK CAB8](http://download.microsoft.com/download/platformsdk/sdk/update/WIN98MeXP/EN-US/2600.2180/FULL/PSDK-FULL.8.cab)\
DOWNLOAD 9/10 [XPSP2 SDK CAB9](http://download.microsoft.com/download/platformsdk/sdk/update/WIN98MeXP/EN-US/2600.2180/FULL/PSDK-FULL.9.cab)\
DOWNLOAD 10/10 [XPSP2 SDK CAB10](http://download.microsoft.com/download/platformsdk/sdk/update/WIN98MeXP/EN-US/2600.2180/FULL/PSDK-FULL.10.cab)\
DOWNLOAD batch file for installation[SDK bat file](http://download.microsoft.com/download/platformsdk/sdk/update/WIN98MeXP/EN-US/2600.2180/FULL/PSDK-FULL.bat)\
DOWNLOAD [Extraction utility](http://download.microsoft.com/download/platformsdk/sdk/update/WIN98MeXP/EN-US/2600.2180/FULL/Extract.exe)

## The road to Nmake.exe

You need this to get nmake.exe, the nmake.exe floating around the net is not the newer\
win32 one for compiling long file name apps\
DO NOT USE THE VS8 UI or Command Pronpt!!\
All we really want here is the correct nmake.exe Copy nmake.exe to VC++ Toolkit\bin and you can even remove VS8 (VS.Net 2005)

Maintenance Utility "NMAKE.EXE" from: Visual C++ 2005 Express Beta\
[VC++ 2005 Download](http://download.microsoft.com/download/1/f/9/1f9c364a-7835-426f-a12e-238bdf8e3ebf/vcsetup.exe)

## Net Framework v2.0

You will need this so that other packages etc will install and function properly\
DOWNLOAD: [Netframework 2.0](http://download.microsoft.com/download/2/d/9/2d96a8eb-a612-46ad-b4ed-6497a8e1f245/dotnetfx.exe)

## Setting the environment

For simplicity i installed everything to custom directories With NO SPACES in the names. If you work in the command line this is easier to type You must set your variable to reflect your installed paths.

SET ENVIRONMENT VARIABLES\
Edit this file (path is where ever you installed to, use CORRECT PATHS!)

`"c:\Compiler\VS8\VC\bin\vcvars32.bat"`

make it read

`Set PATH=C:\compile\VCT2003\bin;%PATH%;c:\compile\vs8\vc\bin;C:\compile\SDK\Bin;C:\compile\sdkxpsp2\Bin`\
`Set INCLUDE=C:\compile\VCT2003\include;%INCLUDE%;C:\compile\sdkxpsp2\Include;C:\compile\SDK\include`\
`Set LIB=C:\compile\VCT2003\lib;%LIB%;c:\compile\sdk\lib;c:\compile\sdkxpsp2\lib`

When working between VB, VCT and your SDKs there are many vcvars32.bat files in various folders. Be sure you have a plan in your head at the start, be aware of which directories you're working in at all times and check every path name for errors before finalizing. If you lose the original information in the wrong file or have trouble translating the directories above to the ones used on your system. Ask the question first and avoid starting from scratch as your only available answer.-- Sneakypete

## Finishing

Once you download the above install in the order i have them listed

1. VC++ Toolkit
2. Win3k Core SDK
3. XPSP2 SDK
4. DOTNET 2.0
5. Visual Studio 8

And you set your environment variables, you then have a fully functional compiling environment, to work on plug-ins, make MQ2, learn programming etc.

Read [THIS](http://lab.msdn.microsoft.com/express/visualc/default.aspx) on setting up the environment in VS 8

## Why do i ....?

WHY NEED "Microsoft Visual C++ Toolkit 2003" WHEN WE HAVE "Visual C++ 2005 Express Beta"\
Because the MSVC-TOOLKIT-2K3 package contains:\
"Microsoft C/C++ Optimizing Compiler and Linker."\
"These are the same compiler and linker that ship with Visual Studio .NET 2003 Professional!"\
WHY NEED ".NET Framework v2"\
Because it's required to install other programming tools.\
WHY dont you explain in here exactly how to compile?\
Because this article is to help you set up an environment to compile\
Not to hold your hand and do everything for you. Search is your friend.

## Now what? (Or it don't F%@$% work)

Ok

1. DO NOT USE VS.Net 8 (2005) GUI, you only need nmake from it
2. open V C++ Toolkit command prompt
3. Run your vcvars.bat you edited
4. type set COMPILER=7
5. Ignore LNK4099 errors, or learn to turn off debug
6. You could copy nmake.exe to vc toolkit's bin and remove VS8 at this point.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://macroquest.gitbook.io/macroquest/documentation/compilers.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
