1 (edited by Rapidgame7 2018-09-01 04:50:26)

Topic: Unable to compile bam 0.4 with MinGW

Im unsure as for what's the place for a topic about bam, whether it should be done here in this subforum, or at its respective Github issues page, but I'll put this up here just in case.

I'm attempting to compile bam 0.4 so I can try to compile Teeworlds 0.6.x, but unpacking bam and trying to compile it via MinGW throws a lot of errors around.
Here's a link to everything that the console ends spewing out.

The .bat file is not being called in its original form, but instead it looks like this

@gcc -Wall -ansi -pedantic src/tools/txt2c.c -o src/tools/txt2c
@src\tools\txt2c.exe src\base.lua src\tools.lua  src\driver_gcc.lua src\driver_cl.lua > src\internal_base.h
@gcc -Wall -ansi -pedantic src/lua/*.c src/lua/*.h src/*.c src/*.h -o bam

lua.h is located at src/lua

What do I do to successfully compile bam? I'm relatively new at compiling programs in general.

2

Re: Unable to compile bam 0.4 with MinGW

src/context.c:2:17: fatal error: lua.h: No such file or directory
#include <lua.h>

You're on Windows? Bam runs on the scripting language Lua, you'll have to install that before anything: https://www.lua.org/download.html

Not Luck, Just Magic.

3

Re: Unable to compile bam 0.4 with MinGW

You should not need lua for bam as it includes a slimmed down version of 5.1 already (see src/lua/IMPORTANTINFO in the bam source folder).

I compiled TW years a go on Linux/Windows ...I think it even worked with mingw somehow. Anyway I did plenty of updates in meanwhile so I tried with VS2017 today and it worked well.

Prerequisite:
python 3.7 64bit - Tick the "add python to PATH" at setup.
VS2017 community edition (had this already for UE4 ... Defaultsetup + Gamedevelopment with C++ to get the v141-Tools)
bam-0.4.0 and teeworlds 0.6.4 from github (get with git or download the zip files)

Afterwards I added a further section in the make_win32_msvc.bat file in the bam folder (as it seems he stopped addin further versions after VS100):

if exist "%VS150COMNTOOLS%" (
    set VSPATH="C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build"
    goto set_env
)

If you have Professional or Express just change the VSPATH to that one (the path should include all those vcvars*.bat files).

After downloading Python, Visual studio 2017 and changing the makefile for bam open a cmd-shell and do:

%comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat"" x86
cd bam-0.4.0
make_win32_msvc.bat
cd ..
cd teeworlds
..\bam-0.4.0\bam.exe server_release

It should not give you any errors. Please don't use the forward / when calling bam like in the howto.

4

Re: Unable to compile bam 0.4 with MinGW

My bad, then!

Not Luck, Just Magic.

5

Re: Unable to compile bam 0.4 with MinGW

Alright then, I'll get VS2017 then compile bam with it, and see what happens!

6 (edited by Rapidgame7 2018-09-02 02:43:35)

Re: Unable to compile bam 0.4 with MinGW

Okay, I was able to compile bam (Thanks!), but I can't compile Teeworlds.
I get just a couple of lines detailing errors about missing types.
I'm not exactly sure what am I doing wrong.

EDIT: I redownloaded the source and used -a, and it just decided to compile.
There were some warnings, but nothing serious.
Apparently config.lua was configured incorrectly or something? I have no idea

7

Re: Unable to compile bam 0.4 with MinGW

Rapidgame7 wrote:

Okay, I was able to compile bam (Thanks!), but I can't compile Teeworlds.
I get just a couple of lines detailing errors about missing types.
I'm not exactly sure what am I doing wrong.

This looked like the generated source files weren't generated correctly. But it seems you solved the problem already.