Compiling with Microsoft Visual Studio Express – Kingpin: Life of Crime

Introduction

Since most people have not Microsoft Developer Studio becouse it’s quite expensive, lucky Microsoft brought a freeware version off it called Microsoft Visual Studio Express.

It has not got a resource editor, but it’s good enough to compile the Kingpin SDK.

These tutorials should work for the following versions:

The following should work but have not really tested them, or maybe need some small adjustments:

It also should work with the Microsoft Developer Studio versions.

 

Creating a New Project

First, we must create the project in which we are going to work:

  1. Start Visual C++ Express Edition
  2. Close any open Workspaces
  3. Choose from the menu File->New-Project
  4. From the New Project dialog choose Win32->Win32 Project
  5. Click in the Project name entry and type a name for your project
  6. Check the Location and make sure it’s correct and press OK
  7. A Win32 Application Wizard dialog will start, click on Next.
  8. Now you got options to select, choose from Application type; DLL and from Additional options;  Empty project and click on Finish.

 

Adding Files to the New Project

Now that we have our project and workspace, we need to add id’s Kingpin SDK source files to the project.

  1. Create a new folder in your project directory called “Source”
  2. Copy the Kingpin source files to this directory
  3. Under the menu Project->Add Exiting Item..
  4. Change to the source directory you just created
  5. Under Files of type choose All Files (*.*) make sure it’s all files otherwise GAME.DEF will be missing (Without GAME.DEF it will compile and no error but the gamex86.dll won’t work)
  6. Select all of the files that appear in the window and click OK

 

Fixing the Compiler

There still some things missing from the compiler the Kingpin SDK. Kingpin needs NavLib.lib otherwise it won’t compile.

  1. menu Project->projectname Properties or ALT+F7
  2. Configuration Manager… button -> Put configuration on Release and click Close
  3. Still in Properties Pages, Configuration Properties->Linker->Input
  4. Then change the Additional Dependencies to Navlib\NavLib.lib or ..\Navlib\NavLib.lib the location where Navlib is.
  5. Add Ignore Specific Library: LIBC.lib
  6. Add Module Definition File: ../GAME.DEF or location where GAME.DEF is
  7. and click OK

To fix the error:

For Visual C++ 2005 Express Edition:
To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.

  1. menu Project->projectname Properties or ALT+F7
  2. Configuration Properties->C/C++>Prepocessor
  3. Add to Preprocessor Definitions: _CRT_SECURE_NO_DEPRECATE
  4. and click OK

For Visual Studio Express 2008, Visual Studio Express 2010 and Visual Studio Express 2012:
To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.

  1. menu Project->projectname Properties or ALT+F7
  2. Configuration Properties->C/C++>Prepocessor
  3. Add to Preprocessor Definitions: _CRT_SECURE_NO_WARNINGS
  4. and click OK

That should remove most warning, for the stricmp error they always should be Q_stricmp.

For Visual Studio Express 2012:
To disable; error LNK2026: module unsafe for SAFESEH image.

  1. menu Project->Properties or ALT+F7
  2. Configuration Properties->Linker->Advanced
  3. Change Image has Safe Exception Handlers to No (SAFESEH:NO)
  4. and click OK

 

To compile the DLL with the correct name and the correct folder for example in game folder of Kingpin (Visual Studio Express 2008):

  1. menu Project->projectname Properties or ALT+F7
  2. Configuration Properties->Linker->General
  3. Output File: $(OutDir)\gamex86.dll
  4. and click OK

To compile the DLL with the correct name  (Visual Studio Express 2010 and Visual Studio Express 2012):

  1. menu Project->Properties or ALT+F7
  2. Configuration Properties->General
  3. Target Name: gamex86
  4. and click OK

 

Download project files

These icons link to social bookmarking sites where readers can share and discover new web pages.

  • email
  • Facebook
  • Google
  • PrintFriendly