Author Topic: [GUIDE] Build FB Neo using MinGW/GCC-4.9.2 (x86 / x64) (rev. 2015)  (Read 58689 times)

Offline CaptainCPS

  • FBNeo Dev
  • ******
  • Posts: 1513
  • Karma: +127/-0
  • FB Alpha Team
    • CaptainCPS's Home
[GUIDE] Build FB Alpha using MinGW/GCC-4.9.2 (x86 / x64)



Welcome to my new 2015 guide that will help those people interested to compile the latest FB Alpha sources. I made this guide as simple and short as possible, I personally made the procedure before writing this up, to make sure everything is all good. As reference, my system is: Windows 8.1 (x64).

This guide might get updated in the future if needed, so check back later if you're interested.

Everything you will find here is based on the original guide by Barry at: http://www.barryharris.me.uk/fba_compile_mingw64.php ; the only difference is that I shortened a few steps as you will see.

No environment variables will be added to Windows, the resulting build environment will serve for the main purpose of compiling FB Alpha. In case you want to uninstall / remove the build environment, you can just remove the installed files and no programs will be affected by this.

I - REQUIREMENTS


Before you proceed you must download the following Self Executable / RAR I prepared that already has TDM-GCC Compiler Suite v4.9.2-3, NASM v2.11.08 and the GNU Utils.

1 - tdm64-gcc-4.9.2-3_MinGW64_NASM_GNUUTILS.exe [102 MB]

The only separate requirement is Active Perl, you must go to the following link and download the one that suit you most (x86 or x64):

2 - http://www.activestate.com/activeperl/downloads

Finally, you will need of course, FB Alpha Latest Source:

3 - http://www.barryharris.me.uk/fba_downloads.php

II - INSTALLING THE COMPILER SUITE


1 - Install / Extract tdm64-gcc-4.9.2-3_MinGW64_NASM_GNUUTILS.exe to c:\mingw64



2 - Install ActivePerl to c:\Perl (assuming you got the x86 version) or c:\Perl64 (for the x64 version)





Note: Make sure to deselect the check boxes, as displayed in the following image:



III - PREPARING FB ALPHA SOURCE


1- Extract fba_src_xxxxxx.7z to c:\fba_dev\fba_src_xxxxxx\

IV - CREATING A BATCH / CMD FILE


A Batch or Cmd is a text-based file that will help us compile FB Alpha easily without having to open Windows Command Prompt, it will automatically summon the Command Prompt and execute the desired commands. Remember to run it as Administrator to avoid any issues with the system.

1- Create a new .TXT document on c:\fba_dev\fba_src_xxxxxx\ and rename it to compile_mingw_gcc492.cmd
2- Open it in NOTEPAD, then COPY / PASTE the following and SAVE it:

Quote
@ECHO OFF
@SET "PATH=c:\mingw64\bin;c:\Perl64\bin"

@mingw32-make mingw471

@PAUSE

V - COMPILING / BUILDING FBA


1- Run compile_mingw_gcc492.cmd (as administrator if you encounter any system access issues)







2- After the process end you will have fba.exe in the same directory. COPY it to another directory before running / testing it, if you want to avoid having many directories created in your FB Alpha Source / development directory.

Note: If you want to build the x64 version of FBA just modify the CMD file with this:

Quote

@mingw32-make mingw471 BUILD_X64_EXE=1

and if you want to build a debug FBA version this:

Quote

@mingw32-make mingw471 BUILD_X64_EXE=1 DEBUG=1

These are located in the makefile, so you could comment/un-comment them as well.

Enjoy!

SeeYa!
:D
« Last Edit: July 12, 2020, 08:19:24 AM by JacKc »

Offline CaptainCPS

  • FBNeo Dev
  • ******
  • Posts: 1513
  • Karma: +127/-0
  • FB Alpha Team
    • CaptainCPS's Home
Re: [Guide] Build FB Alpha using MinGW/GCC-4.9.2 (x86 / x64) (rev. 2015)
« Reply #1 on: April 08, 2015, 08:53:20 PM »
Updated guide with latest build environment (GCC 4.9.2 / MinGW64 / etc) :)

Tested on my actual system, Windows 8.1 (x64), but let me know if you encounter any problem.

SeeYa!
 :biggrin:

Offline Huggybaby

  • Jr. Member
  • **
  • Posts: 91
  • Karma: +2/-0
Re: [Guide] Build FB Alpha using MinGW/GCC-4.9.2 (x86 / x64) (rev. 2015)
« Reply #2 on: April 17, 2015, 04:39:54 PM »
Thanks for the update. :)

Where do I find the latest source? The one linked doesn't seem to include all the newest changes.

<edit> NM, it's classified.
« Last Edit: April 18, 2015, 12:37:23 AM by Huggybaby »

Offline robsons2007

  • Jr. Member
  • **
  • Posts: 61
  • Karma: +0/-0
Re: [Guide] Build FB Alpha using MinGW/GCC-4.9.2 (x86 / x64) (rev. 2015)
« Reply #3 on: October 17, 2015, 09:53:37 AM »
 CaptainCPS
the fba not have support for xp Windws?

Offline Loggan08

  • Newbies
  • *
  • Posts: 10
  • Karma: +0/-0
Would it be possible to do a .vcproj for the 'lazy' like me.

Offline Zetax

  • New Member
  • *
  • Posts: 7
  • Karma: +0/-0
Re: [Guide] Build FB Alpha using MinGW/GCC-4.9.2 (x86 / x64) (rev. 2015)
« Reply #5 on: October 26, 2018, 07:34:08 PM »
The link to the dropbox files is down can some one please provide one that is up?? also does this work with older versions of fba alpha?

Offline dink

  • Administrator
  • *****
  • Posts: 5151
  • Karma: +461/-1
  • pie? I nearly bought one!
Re: [Guide] Build FB Alpha using MinGW/GCC-4.9.2 (x86 / x64) (rev. 2015)
« Reply #6 on: December 30, 2018, 09:02:20 AM »
For those who go the MingW route and like a custom installation (like me), and compile under the mingw shell; here are some tips:
Grab the latest MingW installer and install, at: https://osdn.net/projects/mingw/
While installing MingW: If you get an error on libisl, grab the libisl package directly from the page and unpack it with WinRAR into \mingw

See the attachments:
First expand the dx8 mingw headers and lib directory into \mingw\ - this allows compile of the basic/enhanced blitters

You'll also need the Official MS DirectX 9 headers. 
From the source:  https://www.microsoft.com/en-us/download/details.aspx?id=6812 (573MB)
an Easy route: open the installer exe with WinRAR and copy out the "includes" directory.
From attachment of this message (0.5MB)
Unpack this into c:\mingw and overwrite any .h files which were previously there.

Even though this MingW installs gcc 6.3.0, you'll use the "make mingw510" target, because that's just the target for 5.1.0 and above.

best regards,
- dink
« Last Edit: January 04, 2019, 10:28:19 AM by dink »

Offline Lodan

  • New Member
  • *
  • Posts: 9
  • Karma: +0/-0
Re: [Guide] Build FB Alpha using MinGW/GCC-4.9.2 (x86 / x64) (rev. 2015)
« Reply #7 on: December 31, 2018, 10:34:25 AM »
Is there any plans to implement the building bot AppVeyor into the github source?

Offline Lodan

  • New Member
  • *
  • Posts: 9
  • Karma: +0/-0
Re: [Guide] Build FB Alpha using MinGW/GCC-4.9.2 (x86 / x64) (rev. 2015)
« Reply #8 on: January 03, 2019, 11:06:06 AM »
For those who go the MingW route and like a custom installation (like me), and compile under the mingw shell; here are some tips:
Grab the latest MingW installer and install, at: https://osdn.net/projects/mingw/
While installing MingW: If you get an error on libisl, grab the libisl package directly from the page and unpack it with WinRAR into \mingw

You'll need the Official MS DirectX headers. 
From the source:  https://www.microsoft.com/en-us/download/details.aspx?id=6812 (573MB)
an Easy route: open the installer exe with WinRAR and copy out the "includes" directory.
From attachment of this message (0.5MB)
Unpack this into c:\mingw and overwrite any .h files which were previously there.

Even though this MingW installs gcc 6.3.0, you'll use the "make mingw510" target, because that's just the target for 5.1.0 and above.

best regards,
- dink

I did installed the DX SDK jun2010, perl64, mingw from the link you have shared, did over write the include files, put the nasm.exe inside  C:\MinGW\bin and i did make sure the "C:\Perl64\bin" "C:\MinGW\bin" were added to the variable path. Yet still unable to compile it.

First i have checked if the gcc compiler was available through shell

Code: [Select]
gcc --version
gcc (MinGW.org GCC-8.2.0-1) 8.2.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Then I tried to compile and i got this error:
Code: [Select]
c:\fba_src_0.2.97.44>mingw32-make mingw510 BUILD_X64_EXE=1 DEBUG=0
Making debug build...
ECHO is off.
The syntax of the command is incorrect.
makefile.mingw:772: recipe for target 'init' failed
mingw32-make[1]: *** [init] Error 1
makefile:84: recipe for target 'mingw510' failed
mingw32-make: *** [mingw510] Error 2


I have no idea what I've done wrong

PS: using windowsc 10 x64 build 1809

Offline dink

  • Administrator
  • *****
  • Posts: 5151
  • Karma: +461/-1
  • pie? I nearly bought one!
Re: [Guide] Build FB Alpha using MinGW/GCC-4.9.2 (x86 / x64) (rev. 2015)
« Reply #9 on: January 03, 2019, 09:38:24 PM »
Lodan, run the mingw shell and run "make ming510" from there.  If you don't have an icon for it, \mingw\msys\1.0\msys.bat will bring you there.

tip, if the build stops halfway through, just run make mingw510 again and it will continue.  it usually only affects the first time building.

best regards,
- dink

Offline Lodan

  • New Member
  • *
  • Posts: 9
  • Karma: +0/-0
Re: [Guide] Build FB Alpha using MinGW/GCC-4.9.2 (x86 / x64) (rev. 2015)
« Reply #10 on: January 04, 2019, 10:11:25 AM »
Thank you dink for the enlightenment, i didnt realized the msys-base-bin package was required.

when i tried to make a x86 build I got this error:

Code: [Select]
Compiling src/intf/video/vid_softfx.cpp...
In file included from src/intf/video/vid_softfx.h:11,
                 from src/intf/video/vid_softfx.cpp:4:
src/intf/video/win32/vid_directx_support.h:2:10: fatal error: ddraw.h: No such file or directory
 #include <ddraw.h>
          ^~~~~~~~~
compilation terminated.
makefile.mingw:718: recipe for target 'vid_softfx.o' failed
mingw32-make[1]: *** [vid_softfx.o] Error 1
makefile:84: recipe for target 'mingw510' failed
mingw32-make: *** [mingw510] Error 2

and when i tried compile the x64 build i got this error:

Code: [Select]
$ mingw32-make mingw510 BUILD_X64_EXE=1 DEBUG=0
Making debug build...

Generating depend file for src/burn/drv/cave/d_donpachi.cpp...
cc1plus.exe: sorry, unimplemented: 64-bit mode not compiled in
makefile.mingw:756: recipe for target 'd_donpachi.d' failed
mingw32-make[1]: *** [d_donpachi.d] Error 1
makefile:84: recipe for target 'mingw510' failed
mingw32-make: *** [mingw510] Error 2

I don't have any clue what im doing wrong this time v.v

Offline dink

  • Administrator
  • *****
  • Posts: 5151
  • Karma: +461/-1
  • pie? I nearly bought one!
Re: [Guide] Build FB Alpha using MinGW/GCC-4.9.2 (x86 / x64) (rev. 2015)
« Reply #11 on: January 04, 2019, 10:25:38 AM »
Hmm, I remember now, a long time ago I put dx8 headers on first, then dx9 headers.  dx8 has the ddraw and others.
See attachment :)
after expanding this one, make sure to copy dx9 headers over these, again. (includes directory)
... you also might have to put the lib directory in dx8_mgw.zip into mingw/lib

sorry, my memory is terrible!

I updated the previous info-post w/ new information: http://neo-source.com/index.php?topic=2379.msg26335#msg26335

About 64bit compilation - I don't know, I never tried this.  Also considering the 64bit build has limited blitter support, I don't recommend using it anyways.  Enhanced blitter is really great...
« Last Edit: January 04, 2019, 10:30:33 AM by dink »

Offline Lodan

  • New Member
  • *
  • Posts: 9
  • Karma: +0/-0
Re: [Guide] Build FB Alpha using MinGW/GCC-4.9.2 (x86 / x64) (rev. 2015)
« Reply #12 on: January 04, 2019, 10:53:39 AM »
@dink Thank you very much, it worked ;) successfully compiled the x86 build.
I tried make a non-debug build by using the flag "DEBUG=0" but for some reason made a debug build, yet it's just a minor issue =P

Offline dink

  • Administrator
  • *****
  • Posts: 5151
  • Karma: +461/-1
  • pie? I nearly bought one!
Re: [Guide] Build FB Alpha using MinGW/GCC-4.9.2 (x86 / x64) (rev. 2015)
« Reply #13 on: January 04, 2019, 06:17:48 PM »
@dink Thank you very much, it worked ;) successfully compiled the x86 build.
I tried make a non-debug build by using the flag "DEBUG=0" but for some reason made a debug build, yet it's just a minor issue =P

Great :)

The flags need to be configured by editing the makefile,

best regards,
- dink

Offline r_hunk

  • New Member
  • *
  • Posts: 3
  • Karma: +0/-0
Re: [Guide] Build FB Neo using MinGW/GCC-4.9.2 (x86 / x64) (rev. 2015)
« Reply #14 on: July 16, 2019, 10:12:20 AM »
podr?an subir un paquete, con todo lo necesario para poder compilar