Compiling with Microsoft Visual C++

Introduction

This how-to will explain how to compile Kingpin's GAMEX86.DLL with Visual C++ 6.0 mainly.
Microsoft Developer Studio 6.0 was used to create Kingpin SDK code.
Compiling the DLL is quite simple(one key press), however, setting up the project in VC++ is a little bit more complicated.


 

Open the Default project

  1. Download and unzip install/somewhere the Kingpin SDK.
  2. Open GAME.DSW or GAME.DSP with Visual C++
  3. You already should be able to compile it, with the F7 key or Menu; Build->Build gamex86.dll
  4. If you don't see that options you need to make project first active Menu; Build->Set Active Configuration->game - Win32 Release->OK or you can use the Build->Batch Build.
  5. If it's compiles and you get a error:
    LINK : warning LNK4098: defaultlib "LIBC" conflicts with use of other libs; use /NODEFAULTLIB:library
    You can fix that by adding /nodefaultlib:"LIBC" to the compiler at:
    Menu; Project->Settings or Alt+F7 then Link  tab and then at Project Options just at somewhere at the compiler best probably after /machine:I386  /nodefaultlib:"LIBC" and the error should be gone.

 

Creating a New Project

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

  1. Start Visual C++ 6.0
  2. Close any open Workspaces
  3. Choose New from the File menu
  4. Select the Projects tab and highlight the "Win32 Dynamic-Link Library"
  5. Click in the Project name entry and type a name for your project
  6. Check the Location and make sure it's correct
  7. Make sure the radio button for Create new Workspace is checked
  8. Under Platforms, make sure Win32 is checked then click OK
  9. A new Window will popup "What king of DLL would you like to create?"
    Choose: An empty DLL project. and then click 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 To Project->Files.
  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. To make sure the compiler is set to release:

  • Under menu; Build->Set Active Configuration->game - Win32 Release->OK

To add Navlib.lib:

  1. Under menu; Project->Settings...
  2. Tab Link and then under Object Libary Modules add NavLib\NavLib.lib or the correct location of Navlib.lib from the Kingpin SDK source files for example: ..\NavLib\NavLib.lib if it's a directory lower.
  3. If there other lib files just remove them there not nessarcy and can give problems the only lib files you can use are: navlib\navlib.lib kernel32.lib user32.lib winmm.lib
  4. Also vink Doesn't Produce .LIB on and click OK

To fix the error:

LINK : warning LNK4098: defaultlib "LIBC" conflicts with use of other libs; use /NODEFAULTLIB:library

  1. Under menu; Project->Settings...
  2. Tab Link and then change Category to Input
  3. Now you see a new option and add LIBC to Ignore Libraries and press the OK button

To compile the DLL with the correct name and the correct folder for example in game folder of Kingpin:

  1. Under menu; Project->Settings...
  2. Tab Link and then change output filename to the game folder for example
    c:\games\kingpin\mod\gamex86.dll
  3. and click OK

 

Download project file

Microsoft Visual 6.0

FREDZ | Monday 09 May 2016 - 00:58
These icons link to social bookmarking sites where readers can share and discover new web pages.
  • email
  • Facebook
  • Google
  • PrintFriendly