Microsoft Visual C

From GMod Wiki

Jump to: navigation, search


Patches.png Go to:
Development Tools


Warning 64.pngThis page needs to be edited as it contains information that is unclear or incorrect. Improvement can be discussed on the talk page. Find more pages that need work here.
Details: None given.

Note that the ++ was missing off the page name due to a limitation of MediaWiki

Contents

What is it?

Microsoft Visual C++ Express Edition is a free version of Microsoft's Visual C++.

It allows developers to write C++ applications with relative ease using both the IntelliSense © as well as integration into the Microsoft Developer Network.

With the correct configuration it is able to develop binary third party modules for Garry's Mod with relative ease.

In this article I will outline on how to set up your computer and your compiler so that you are able to compile binary modules for Garry's Mod.

Where to get?

Microsoft Visual C++ Express Edition 2008 can be obtained here.

Note that it does require registration and the entering of a "registration key" for it to remain active, failure to provide a free key results in a 30 day "trial" period after which you will need to register it for free.

Getting started

Here I will show you how I got started in compiling the gm_sqlite module, its the best example on how to code modules for Garry's Mod.

Requirements

For this tutorial you will need the following

Setting up your Source SDK "source"

In order to compile some binary modules, you are required to have the Source SDK headers.

These headers can be obtained by creating a new "mod" on your hard drive using the Source SDK, below are some instructions on how to do so.

Method

  1. Start the Source SDK
  2. Ensure that you have the following settings selected on the "Source SDK" (these are what I am using, you may be able to get it to work with other Engine/Game combos)
    Engine Version: The Orange Box
    Current Game: Half-Life 2: Episode Two
  3. Under utilities, Double click on "Create a Mod", this should bring up a "Create a Mod" dialog
  4. Select "Source code only (advanced users only)" then click next
  5. Choose a directory, in this tutorial I will use "C:\HL2SDK" as my directory as its easier to find, Click Next
  6. Wait for the dialog to finish copying files, When finished, Click Next
  7. Uncheck "Open readme file" (unless you REALLY want to read the read me file...)
  8. Click "Finish", that should return you to the "Source SDK" window.

Congratulations, you now have the source code required to compile a Garry's Mod binary module, please see the next section on getting the lua interface header files.

Setting up your Lua Interface files

Setting up the Lua Interface files so that MSVC++ is able to find the files should a project not include them will make your life allot easier when you go to compile such a project.

This is probably the easiest part of this process :)

Method

  1. In keeping with the previous part, create a folder on your hard drive (same one that you dumped the source code on) and call it "GMOD-Interface"
  2. Using a SVN Program (e.g. Tortoise SVN) do a check-out on the folder you just created to the following SVN URL (or http://gmodmodules.googlecode.com/svn/trunk/secretheaders/)
  3. Step 3) Wait for the SVN to complete, once completed, click "OK"
  4. You now have the headers required to compile a binary modules, now lets move on to setting up MSVC++

Setting up Microsoft Visual C++ 2008 Express Edition

(Note this page is a work in progress and may take some time as I have to take screen shots)

To get started quickly, do the following

Bring up your VC++ Directory settings, this can be found under Tools -> Options.. -> "Projects and Solutions" -> "VC++ Directories"

Required Include Directories (listed as "Include files")

Required Library Directories (listed as "Library files")

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox