Author Topic: [Guide] Compiling FBA with MS Visual Studio (2010) and MinGW  (Read 12671 times)

Offline CaptainCPS

  • FBNeo Dev
  • ******
  • Posts: 1513
  • Karma: +127/-0
  • FB Alpha Team
    • CaptainCPS's Home
[Guide] Compiling FBA with MS Visual Studio (2010) and MinGW
« on: September 27, 2010, 01:12:25 AM »
Compiling FBA with MS Visual Studio (2010) and MinGW

:: About this guide

The objective of this guide is to help developers setup their preferred environment to compile FB Alpha source. There has been multiple guides to setup different environments that will allow developers to compile older FB Alpha sources, but over the time new features that required specific libraries and / or headers have been added to FB Alpha, this is why new guides have been created to keep up with the newest requirements for a successful compilation of the FB Alpha source.

This guide will allow you to compile version 0.2.97.08 (released February 28, 2010), but may work with older FB Alpha sources as well (more information about compilation results with older sources will be posted soon).

This thread will be updated soon with the MinGW guide as well, I'm still preparing it. Other updates will be posted here as needed.

The previous guide I made is located here for documentation purposes, works with older FB Apha sources:

http://neo-source.com/index.php?topic=1041.0



:: Requirements

Windows Operative System ( XP / Vista / 7 ) (32 / 64 bit).



:: Microsoft Visual Studio Environment (2010)

We will need to download the following packages from Microsoft download website before we begin:




:: Installation of Packages

After acquiring those installation packages proceed to install each one of them to your preferred location. The following installation path structure is the one I personally use:

E:\_ProgramFiles_\MS VStudio 10
E:\_ProgramFiles_\Microsoft SDKs\Windows\v7.1
E:\_ProgramFiles_\Microsoft DirectX SDK (June 2010)


Note: Remember where you installed each one because we will need to use those paths soon.



:: Extra binaries / Tools

Since FB Alpha make use of various tools at build event we will need to download a few extra binaries that include the following:

  • Perl 5.0
  • Nasm 2.03
  • UnixUtils

I made a package of the needed binaries, so there is no need to go around looking for each one. You can download the package here:


EDIT: New package uploaded, should compile without errors, I forgot to add some important PERL files and directory structures. I will upload all files to my personal server later because MegaUpload is a pain in the ass xD.

The package should be extracted to a path of your preference. The following path is the one I personally use:

E:\fbaxbins

Note: Remember this path as well since we will use it soon.



:: Old DirectX Libraries

FB Alpha make use of some old DirectX libraries and since Microsoft doesn't include some of them in the newer SDKs we will have to manually include them to where we installed the new DirectX SDK. The needed libraries and header files must be extracted from the DirectX SDK - August 2007. These are the files:

include\d3d.h
include\d3dcaps.h
include\d3dtypes.h
include\d3dvec.inl

lib\x86\ddraw.lib
lib\x86\dinput.lib
lib\x86\dxguid.lib (this file must overwrite the newer SDK one, a backup of the file is recommended)

lib\x64\ddraw.lib
lib\x64\dinput.lib
lib\x64\dxguid.lib (this file must overwrite the newer SDK one, a backup of the file is recommended)

You can extract these files from the original DirectX SDK from August 2007, or you can download a package I made here:


After downloading you must extract the contents and drag them to your DirectX SDK directory, for example in my case it would be here:

E:\_ProgramFiles_\Microsoft DirectX SDK (June 2010)

Windows will prompt you to update / overwrite contents of the directories, when that happens press OK.



:: Creating a .CMD / .BAT file

Now we are going to create a CMD / BAT file that will allow us to setup everything with a few commands, execute the build event and leave us with a FBA build ready to use.

Open Notepad, copy and paste the following commands (you must edit the paths according to where you installed everything):

EDIT: Updated with new FBA Extra binaries.

Code: [Select]
ECHO OFF
CLS
SET VSTools="E:\_ProgramFiles_\MS VStudio 10\VC"
CALL "E:\_ProgramFiles_\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x86 /xp /Release
CALL "E:\_ProgramFiles_\Microsoft DirectX SDK (June 2010)\Utilities\bin\dx_setenv.cmd"
CALL "E:\_ProgramFiles_\MS VStudio 10\VC\vcvarsall.bat"

PATH = E:\fbaxbins_v2\unixutils\bin;%path%
PATH = E:\fbaxbins_v2\perl\bin\MSWin32-x86;%path%
PATH = E:\fbaxbins_v2\nasm-2.03.01;%path%

MAKE vc
ECHO _
ECHO FB Alpha Compilation done. [MSVC Tools Environment]
ECHO _
PAUSE

Save the file as a .CMD or .BAT file in the FB Alpha Source directory, where Makefiles are located ( Ex. E:\fba_src ), you can do that by writting the extension in the Save dialog after the file name, for example: vc_make.cmd, then click Save.



:: Compile

Finally run the .CMD / .BAT file, sit back and wait while your FBA build is compiled  :smilie:.



:: MinGW Environment (Coming Soon!)

SeeYaa!
 :biggrin:
« Last Edit: November 10, 2011, 06:44:16 PM by CaptainCPS »

Offline FerchogtX

  • FBNeo Dev
  • ******
  • Posts: 375
  • Karma: +7/-0
  • FB Alpha Team ;)
    • FB Alpha Plus! Web Site
Re: [Guide] Compiling FBA with MS Visual Studio (2010) and MinGW
« Reply #1 on: September 29, 2010, 12:02:51 AM »
Compiling FB Alpha using MinGW + GCC 3.4.5


With this setup, you only need to follow the instructions of the batch file, for example, if you type 3, you will get the debug build, also, avoids the use of cmd.exe, you can double-click this and start compiling.

Remember, when in the perl install part, you only need the zip file, not the whole installer, also, you need to decompress only the perl folder inside the zip, so you have a MinGW\perl structure, with bin and lib folders inside it.

If you set up MinGW in another drive that is NOT C:, then change the drive letter in the batch file acordingly (for example if you set up in H: drive, you must change C: into H: in the set PATH sentence.

I hope this help you compiling FB Alpha.

See ya!!!!! :D

EDIT: Updated, now the enviornment is set including  UPX, so you can compress without problems, the batch file is updated also, and adds some fancy stuff XD...
« Last Edit: October 10, 2010, 01:34:49 AM by FerchogtX »

Good and evil co-exist because of the balance, lies are not part of it...

FB Alpha Plus! site infos updated, see the latest info clicking on my profile link...

Offline CaptainCPS

  • FBNeo Dev
  • ******
  • Posts: 1513
  • Karma: +127/-0
  • FB Alpha Team
    • CaptainCPS's Home
Re: [Guide] Compiling FBA with MS Visual Studio (2010) and MinGW
« Reply #2 on: October 14, 2010, 08:01:24 AM »
Thank you FerchogtX :), I appreciate the time you took to make the MinGW Guide. This will help a lot of people in the future ^^.

SeeYaa!
 :biggrin:

Offline CaptainCPS

  • FBNeo Dev
  • ******
  • Posts: 1513
  • Karma: +127/-0
  • FB Alpha Team
    • CaptainCPS's Home
Re: [Guide] Compiling FBA with MS Visual Studio (2010) and MinGW
« Reply #3 on: October 14, 2010, 11:48:57 AM »
Updated the MS Visual Studio (2010) guide with a new working "fbaxbins_v2.zip" with FBA Extra Binaries. The CMD file code was updated as well with the new directory structures.

SeeYaa!
 :biggrin:

Offline vbt

  • FBNeo Contributor
  • *****
  • Posts: 205
  • Karma: +9005/-0
Re: [Guide] Compiling FBA with MS Visual Studio (2010) and MinGW
« Reply #4 on: November 10, 2010, 06:54:57 AM »
Nice MiniGW tutoril, i followed it. The first time it worked perfectly :biggrin: :cool:
But when I run again the build.bat i got this :

Quote
Initializing FB Alpha Driverlist Generator...
Directories scanned, continue to get driver's structure data
Verifying driverlist.h structure
driverlist.h was verified and doesn't need to be updated
gamelist.html was successfully generated!
rm: driverlist_gen.exe: failed to delete
mingw32-make[1]: *** [src/generated/driverlist.h] Error 1
mingw32-make: *** [mingw345] Error 2

Any idea why ?

Offline FerchogtX

  • FBNeo Dev
  • ******
  • Posts: 375
  • Karma: +7/-0
  • FB Alpha Team ;)
    • FB Alpha Plus! Web Site
Re: [Guide] Compiling FBA with MS Visual Studio (2010) and MinGW
« Reply #5 on: November 10, 2010, 11:53:03 PM »
Is your fa folder read only? I didn't have any issue, and I've tested on 2 machnes :/

See ya!!! :D

Good and evil co-exist because of the balance, lies are not part of it...

FB Alpha Plus! site infos updated, see the latest info clicking on my profile link...

Offline shenglong

  • New Member
  • *
  • Posts: 1
  • Karma: +0/-0
Re: [Guide] Compiling FBA with MS Visual Studio (2010) and MinGW
« Reply #6 on: June 29, 2011, 08:05:27 AM »
great guides thanks for them, had a bit of a problem compiling on x64 OS (kept trying to set directx vars as x64 instead of x86) but managed to sort it out :)

Offline VonSi

  • New Member
  • *
  • Posts: 3
  • Karma: +0/-0
Re: [Guide] Compiling FBA with MS Visual Studio (2010) and MinGW
« Reply #7 on: February 16, 2013, 10:41:38 PM »
Hi FerchogtX!

Can you upload "FB Alpha Extra Utils", "fbaxbins_v2.zip" and "fba_dxsdk_aug07.zip" again?
the link expired

thx!
« Last Edit: February 19, 2013, 02:25:09 AM by VonSi »