Mingw+msys compiling: requesting help

Hi,

I have been using this guide

http://www.netadelica.com/coding/sdl/install.html

trying to get the source code to compile, unfortunately after hours wasted I keep getting the same cc translationtable error.

Here are the scarce instructions:

?Copy config.template to config.default, edit the resulting file: Uncomment ONE language, optionally uncomment some build options.
For MSYS+MinGW uncomment the parts specific to it regarding SDL and adjust the path to SDL as necessary
?Build it by typing make (or gmake on some platforms)
?Start the game once, it will generate a config file .ja2/ja2.ini (or JA2/ja2.ini on Windows) in your home directory and terminate. Edit the file and adjust the path in their to point to your Jagged Alliance 2 data files.

In the config.default I point exactly to where my sdl-config is not the folder but the file itself, it still doesn’t work.
Requesting assistance from anyone with mingw+msys compiling experience, can you compile a executable out of this cource code (windows xp 32bits)

sc download mirrors:

http://www.filesavr.com/ja2source

http://www.filedropper.com/ja2source

http://www.megaupload.com/?d=LYLO9RCG

http://ingar.satgnu.net/mingw/index.htmlOn 04/02/2010 02:52 PM, Triarii wrote:

Hi,

I have been using this guide

http://www.netadelica.com/coding/sdl/install.html

trying to get the source code to compile, unfortunately after hours
wasted I keep getting the same cc translationtable error.

Here are the scarce instructions:

Quote:

.Copy config.template to config.default, edit the resulting file:
Uncomment ONE language, optionally uncomment some build options.
For MSYS+MinGW uncomment the parts specific to it regarding SDL and
adjust the path to SDL as necessary
.Build it by typing make (or gmake on some platforms)
.Start the game once, it will generate a config file .ja2/ja2.ini (or
JA2/ja2.ini on Windows) in your home directory and terminate. Edit the
file and adjust the path in their to point to your Jagged Alliance 2
data files.

In the config.default I point exactly to where my sdl-config is not
the folder but the file itself, it still doesn’t work.
Requesting assistance from anyone with mingw+msys compiling
experience, can you compile a executable out of this cource code
(windows xp 32bits)

sc download mirrors:

http://www.filesavr.com/ja2source

http://www.filedropper.com/ja2source

http://www.megaupload.com/?d=LYLO9RCG


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Marcel Wysocki wrote:

http://ingar.satgnu.net/mingw/index.html (http://ingar.satgnu.net/mingw/index.html)

that has gotta be a simpler method to just compile sdl without all this…

common sense tells me to edit the file with notepad in windows and rename it to .default but if I do that it gives me a CCtranslationtable error

how do I edit config.default from the msys console?

Hi Triarii

common sense tells me to edit the file with notepad in windows and rename it to .default but if I do that it gives me a CCtranslationtable error

how do I edit config.default from the msys console?

Maybe config.template / config.default contains Unix line endings, which
notepad.exe (“Editor”) can’t handle (even on Vista…).

Try using wordpad.exe (found in Start Menu > Programs > Accessories > WordPad or
something like that). It should be able to handle Unix line endings. Or try some
more advanced text editor.

If you can’t find one, convert the line endings using this MinGW command:
unix2dos config.default

Then edit the file using notepad.

Afterwards, convert the line endings back, just to be sure:
dos2unix config.default

unix2dos and dos2unix are part of the mingw-utils package. The version I use can
be found here:
http://sourceforge.net/projects/mingw/files/MinGW%20Utilities/mingw-utils/mingw-utils-0.3/mingw-utils-0.3.tar.gz/download

I keep getting the same cc translationtable error.

If the line endings thing didn’t help, please post the exact error message and
anything else that make/the compiler printed around it.

For example, if the command that failed was:
make
Then change it to:
make >makelogfile.txt 2>&1
You will not see any messages, as they all go into makelogfile.txt (in the
current working directory).

Edit makelogfile.txt and remove anything you don’t want us to see (it might
contain your real name, for example). Again, use a Unix-friendly text editor or:
unix2dos makelogfile.txt

Then post the file here.

Martin

The best editors to use on windows as a notepad replacement are Notepad++ or
Ultraedit.On Sun, Apr 4, 2010 at 11:45 PM, Martin <name.changed.by.editors at online.de>wrote:

Hi Triarii

common sense tells me to edit the file with notepad in windows and rename

it to .default but if I do that it gives me a CCtranslationtable error

how do I edit config.default from the msys console?

Maybe config.template / config.default contains Unix line endings, which
notepad.exe (“Editor”) can’t handle (even on Vista…).

Try using wordpad.exe (found in Start Menu > Programs > Accessories >
WordPad or something like that). It should be able to handle Unix line
endings. Or try some more advanced text editor.

If you can’t find one, convert the line endings using this MinGW command:
unix2dos config.default

Then edit the file using notepad.

Afterwards, convert the line endings back, just to be sure:
dos2unix config.default

unix2dos and dos2unix are part of the mingw-utils package. The version I
use can be found here:

http://sourceforge.net/projects/mingw/files/MinGW%20Utilities/mingw-utils/mingw-utils-0.3/mingw-utils-0.3.tar.gz/download

I keep getting the same cc translationtable error.

If the line endings thing didn’t help, please post the exact error message
and anything else that make/the compiler printed around it.

For example, if the command that failed was:
make
Then change it to:
make >makelogfile.txt 2>&1
You will not see any messages, as they all go into makelogfile.txt (in the
current working directory).

Edit makelogfile.txt and remove anything you don’t want us to see (it might
contain your real name, for example). Again, use a Unix-friendly text editor
or:
unix2dos makelogfile.txt

Then post the file here.

Martin


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

You could also try out the free Visual C++ 2008 Express Edition which
has some nice automatic code-formatting support.On 4/4/10 3:06 PM, Paulo Pinto wrote:

The best editors to use on windows as a notepad replacement are
Notepad++ or Ultraedit.

On Sun, Apr 4, 2010 at 11:45 PM, Martin <name.changed.by.editors at online.de <mailto:name.changed.by.editors at online.de>> wrote:

Hi Triarii

    common sense tells me to edit the file with notepad in windows
    and rename it to .default but if I do that it gives me a
    CCtranslationtable error

     how do I edit config.default from the msys console?


Maybe config.template / config.default contains Unix line endings,
which notepad.exe ("Editor") can't handle (even on Vista...).

Try using wordpad.exe (found in Start Menu > Programs >
Accessories > WordPad or something like that). It should be able
to handle Unix line endings. Or try some more advanced text editor.

If you can't find one, convert the line endings using this MinGW
command:
unix2dos config.default

Then edit the file using notepad.

Afterwards, convert the line endings back, just to be sure:
dos2unix config.default

unix2dos and dos2unix are part of the mingw-utils package. The
version I use can be found here:
http://sourceforge.net/projects/mingw/files/MinGW%20Utilities/mingw-utils/mingw-utils-0.3/mingw-utils-0.3.tar.gz/download


    I keep getting the same cc translationtable error.


If the line endings thing didn't help, please post the exact error
message and anything else that make/the compiler printed around it.

For example, if the command that failed was:
make
Then change it to:
make >makelogfile.txt 2>&1
You will not see any messages, as they all go into makelogfile.txt
(in the current working directory).

Edit makelogfile.txt and remove anything you don't want us to see
(it might contain your real name, for example). Again, use a
Unix-friendly text editor or:
unix2dos makelogfile.txt

Then post the file here.


Martin
_______________________________________________
SDL mailing list
SDL at lists.libsdl.org <mailto:SDL at lists.libsdl.org>
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Doesn’t nedit (nirvana editor) run on Windows?On Sunday 04 April 2010 15:14, Andreas Schiffler wrote:

You could also try out the free Visual C++ 2008 Express Edition which
has some nice automatic code-formatting support.

On 4/4/10 3:06 PM, Paulo Pinto wrote:

The best editors to use on windows as a notepad replacement are
Notepad++ or Ultraedit.

nirvana editor is not available for windows, but I used notepad++ and windows wordpad and keep getting the same error.

straight from the ‘makelogfile’

===> CC sgp/TranslationTable.c
make: cc: Command not found
make: *** [sgp/TranslationTable.o] Error 127

translationtable is a C file

http://www.filesavr.com/translationtable

no idea what to do now

Can you run the command “cc” from the MSYS command line? I think calling
this a translation table error is not correct - this error is telling you it
can’t run the compiler.On Mon, Apr 5, 2010 at 8:17 AM, Triarii wrote:

nirvana editor is not available for windows, but I used notepad++ and
windows wordpad and keep getting the same error.

straight from the ‘makelogfile’

Quote:

===> CC sgp/TranslationTable.c
make: cc: Command not found
make: *** [sgp/TranslationTable.o] Error 127

translationtable is a C file

http://www.filesavr.com/translationtable

no idea what to do now


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

I can’t

"

sh: cc: command not found

"

?

now I’m absolutely lost as I did everything the guide told me to and I compiled my test sdl program (the one with the revolting white dots/stars in the black window) and my sdl compile is working fine

I think we just found the problem. The guide has you using gcc as the
compiler command, and the translation table source file wants to be
compiled with cc. Since you’re running this on windows, try this: find
gcc.exe on your hard drive. Copy and paste gcc.exe into the same
directory (this should result in a file named “copy of gcc.exe”).
Rename the copy to cc.exe. Then try to build JA2 again (by going into
whichever directory and running make from the command line, as your
initial post stated). This should get you further.On Mon, Apr 5, 2010 at 10:22 AM, Triarii wrote:

I can’t

"

sh: cc: command not found

"

?

now I’m absolutely lost as I did everything the guide told me to and I
compiled my test sdl program (the one with the revolting white dots/stars in
the black window) and my sdl compile is working fine


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Following what Justin Coleman said I finally got a *.exe …

I’m gonna see if it works but I saw some errors as it was compiling

questions:

Where can I download the official ‘cc.exe’? so I don’t have to use ‘gcc.exe’ renamed

I had to put the command ‘make LNG=ENGLISH PREFIX=COMPAQ’ as it simply didn’t work with just make as it doesn’t recognize my config.default… my question I wanted this to not create folders and ja2.ini in the compaq-my documents but in the c:\program files\ja2 game directory itself … is there any way to do that?> # NOTE: This file is ONLY intended as template config file for manual builds.

If you are building a package (or ebuild, spell, source rpm, …) do NOT

modify this file, use sed or whatever. In fact do NOT use this file AT ALL.

Just pass parameters to make. This is much simpler and way less error prone

this way. This file is NOT intended for package building. For a package

just use

make LNG=$YOUR_LANGUAGE PREFIX=$YOUR_PREFIX

as build command and maybe some more variables, though on a sane system this

should not be necessary.

Uncomment exactly ONE of these

#LNG := DUTCH
#LNG := ENGLISH
#LNG := FRENCH
#LNG := GERMAN
#LNG := ITALIAN
#LNG := POLISH

Russian BUKA Agonia Vlasti release

#LNG := RUSSIAN

Russian Gold release

#LNG := RUSSIAN_GOLD

#JA2BETAVERSION := yes
#JA2TESTVERSION := yes
#JA2EDITOR := yes
#WITH_DEMO := yes
#WITH_DEMO_ADS := yes
#WITH_FIXMES := yes
#WITH_MAEMO := yes
#WITH_SOUND_DEBUG := yes

#CFLAGS += -g
#CFLAGS += -Werror

Specify here were the Jagged Alliance 2 data files are located

#SGPDATADIR := /usr/local/share/ja2

Tunables for installation. The default values are shown

#PREFIX := /usr/local
#MANPREFIX := $(PREFIX)

#INSTALL := install
#INSTALL_PROGRAM := $(INSTALL) -m 555 -s
#INSTALL_MAN := $(INSTALL) -m 444
#INSTALL_DATA := $(INSTALL) -m 444

Below are some example variable overrides for MSys/MinGW

If you set CFLAGS_SDL and LDFLAGS_SDL explicitly, then SDL_CONFIG is ignored

#SDL_CONFIG := sdl-config
#SDL_PATH := …/sdl-1.2.11
#CFLAGS_SDL := -I $(SDL_PATH)/include
#LDFLAGS_SDL := -L $(SDL_PATH)/lib -lmingw32 -lSDLmain -lSDL

Thanks to what Justin Coleman suggested I was able to compile it by simply renaming gcc.exe to cc.exe

Been using it for a few hours and it’s working perfectly, if anyone wants this game let me know I’d be happy to send as it works beautifully with sdl.

Anyway I just have 2 questions since I have everything set up to compile I’d like to include a change in the source code that someone made… I know I’m a complete ignorant but do I put this commands in the msys console or do I edit the JA2Screens.h and JA2screens.cc files in the build directory ???

Code:
Index: Build/JAScreens.h===================================================================
— Build/JAScreens.h (revision 7056)
+++ Build/JAScreens.h (working copy)
@@ -4,7 +4,13 @@
#include “ScreenIDs.h”
#include “Types.h”

+/* mgl: Clothes change

    • SOLDIERTYPE, resp PaletteRepID defined there
  • */
    +#include “Soldier_Control.h”
    +#include “Overhead_Types.h”

ScreenID ErrorScreenHandle(void);

ScreenID InitScreenHandle(void);
@@ -38,4 +44,10 @@
ScreenID DemoExitScreenHandle(void);
#endif

+/* mgl: Clothes change

    • Exported function.
    • It was a local function called by “PalEditScreenHandle()”.
  • */
    +void CyclePaletteReplacement(SOLDIERTYPE& s, PaletteRepID pal);

#endif
Index: Build/JAScreens.cc

— Build/JAScreens.cc (revision 7056)
+++ Build/JAScreens.cc (working copy)
@@ -285,7 +285,10 @@
}

-static void CyclePaletteReplacement(SOLDIERTYPE& s, PaletteRepID pal)
+/* mgl: Clothes change

    • Exported function.
  • */
    +void CyclePaletteReplacement(SOLDIERTYPE& s, PaletteRepID pal)
    {
    UINT8 ubPaletteRep = GetPaletteRepIndexFromID(pal);
    const UINT8 ubType = gpPalRep[ubPaletteRep].ubType;
    Index: Build/Tactical/Turn_Based_Input.cc
    ===================================================================
    — Build/Tactical/Turn_Based_Input.cc (revision 7056)
    +++ Build/Tactical/Turn_Based_Input.cc (working copy)
    @@ -1354,6 +1354,39 @@
    case ‘g’: HandlePlayerTogglingLightEffects(TRUE); break;
    case ‘h’: ShouldTheHelpScreenComeUp(HELP_SCREEN_TACTICAL, TRUE); break;
    case ‘i’: ToggleItemGlow(!gGameSettings.fOptions[TOPTION_GLOW_ITEMS]); break;
  •   /* mgl: kbd shortcut 'j' = climb roof. From JA2 v1.13 */
    
  •   case 'j':
    
  •   	{
    
  •   	SOLDIERTYPE* const s = GetSelectedMan();
    
  •   	if (!s) { break; }
    
  •   	// Prevent the robot, Maria, Joey etc from climbing
    
  •   	if (!IsValidStance(s, ANIM_CROUCH)) { break; }
    
  •   	// Make sure the merc is not collapsed!
    
  •   	if (s->bCollapsed && s->bBreath < OKBREATH)
    
  •   	{
    
  •   		// Merc can't change stance message
    
  •   		ScreenMsg(FONT_MCOLOR_LTYELLOW,
    
  •   		          MSG_UI_FEEDBACK,
    
  •   		          gzLateLocalizedString[3],
    
  •   		          s->name);
    
  •   		break;
    
  •   	}
    
  •   	if (FindHigherLevel(s))
    
  •   	{	 BeginSoldierClimbUpRoof(s);
    
  •   	}
    
  •   	else if (FindLowerLevel(s))
    
  •   	{ 	BeginSoldierClimbDownRoof(s);
    
  •   	}
    
  •   	else if (FindFenceJumpDirection(s))
    
  •   	{	 BeginSoldierClimbFence(s);
    
  •   	}
    
  •   	break;
    
  •   	} /* case 'j' */
    
  •   case 'k': BeginKeyPanelFromKeyShortcut();                              break;
    
      case 'l':
    

@@ -1561,6 +1594,18 @@
}
break;

  •   /* mgl: Clothes change */
    
  •   case 'v':
    
  •   {
    
  •   SOLDIERTYPE* const s = GetSelectedMan();
    
  •   if (!s) { break; }
    
  •   // Anyone except the robot can change clothes
    
  •   if (AM_A_ROBOT(s)) { break; }
    
  •   CyclePaletteReplacement(*s, s->VestPal);
    
  •   break;
    
  •   }
    

#ifdef JA2BETAVERSION
case ‘l’:
{
@@ -1573,6 +1618,17 @@
}
#endif

  •   /* mgl: Clothes change */
    
  •   case 'p':
    
  •   {
    
  •   SOLDIERTYPE* const s = GetSelectedMan();
    
  •   if (!s) { break; }
    
  •   // Anyone except the robot can change clothes
    
  •   if (AM_A_ROBOT(s)) { break; }
    
  •   CyclePaletteReplacement(*s, s->PantsPal);
    
  •   break;
    
  •   }
    
  •   case SDLK_F1:
      case SDLK_F2:
      case SDLK_F3:

My second question is that right now the game is C:\program files\JA2 and the *.exe I compiled creates a JA2 folder in my documents and a bunch of stuff inside that folder

I’d like the game to be contained inside the program files\ja2 folder like it’s the norm but I can’t figure out what do I put in
MANPREFIX= ?

Tunables for installation. The default values are shown

#PREFIX := /usr/local
#MANPREFIX := $(PREFIX)

thanks for all your help

As long as you have the GNU tools, you can apply a diff patch like so:
patch <mypatchfile

This will work if you’re in the parent directory of ‘Build’. If you’re in
the Build directory, use:
patch -p1 <mypatchfile

Check out man patch (even though it sounds funny, tee hee).

Jonny DOn Thu, Apr 8, 2010 at 4:44 AM, Triarii wrote:

Thanks to what Justin Coleman suggested I was able to compile it by
simply renaming gcc.exe to cc.exe

Been using it for a few hours and it’s working perfectly, if anyone wants
this game let me know I’d be happy to send as it works beautifully with sdl.

Anyway I just have 2 questions since I have everything set up to compile
I’d like to include a change in the source code that someone made… I know
I’m a complete ignorant but do I put this commands in the msys console or do
I edit the JA2Screens.h and JA2screens.cc files in the build directory ???

Code:

Index: Build/JAScreens.h

— Build/JAScreens.h (revision 7056)
+++ Build/JAScreens.h (working copy)
@@ -4,7 +4,13 @@
#include “ScreenIDs.h”
#include “Types.h”

+/* mgl: Clothes change

    • SOLDIERTYPE, resp PaletteRepID defined there
  • */
    +#include “Soldier_Control.h”
    +#include “Overhead_Types.h”

ScreenID ErrorScreenHandle(void);

ScreenID InitScreenHandle(void);
@@ -38,4 +44,10 @@
ScreenID DemoExitScreenHandle(void);
#endif

+/* mgl: Clothes change

    • Exported function.
    • It was a local function called by “PalEditScreenHandle()”.
  • */
    +void CyclePaletteReplacement(SOLDIERTYPE& s, PaletteRepID pal);

#endif
Index: Build/JAScreens.cc

— Build/JAScreens.cc (revision 7056)
+++ Build/JAScreens.cc (working copy)
@@ -285,7 +285,10 @@
}

-static void CyclePaletteReplacement(SOLDIERTYPE& s, PaletteRepID pal)
+/* mgl: Clothes change

    • Exported function.
  • */
    +void CyclePaletteReplacement(SOLDIERTYPE& s, PaletteRepID pal)
    {
    UINT8 ubPaletteRep = GetPaletteRepIndexFromID(pal);
    const UINT8 ubType = gpPalRep[ubPaletteRep].ubType;
    Index: Build/Tactical/Turn_Based_Input.cc
    ===================================================================
    — Build/Tactical/Turn_Based_Input.cc (revision 7056)
    +++ Build/Tactical/Turn_Based_Input.cc (working copy)
    @@ -1354,6 +1354,39 @@
    case ‘g’: HandlePlayerTogglingLightEffects(TRUE);
    break;
    case ‘h’: ShouldTheHelpScreenComeUp(HELP_SCREEN_TACTICAL, TRUE);
    break;
    case ‘i’:
    ToggleItemGlow(!gGameSettings.fOptions[TOPTION_GLOW_ITEMS]); break;

  •  /* mgl: kbd shortcut 'j' = climb roof. From JA2 v1.13 */
    
  •  case 'j':
    
  •     {
    
  •     SOLDIERTYPE* const s = GetSelectedMan();
    
  •     if (!s) { break; }
    
  •     // Prevent the robot, Maria, Joey etc from climbing
    
  •     if (!IsValidStance(s, ANIM_CROUCH)) { break; }
    
  •     // Make sure the merc is not collapsed!
    
  •     if (s->bCollapsed && s->bBreath < OKBREATH)
    
  •     {
    
  •        // Merc can't change stance message
    
  •        ScreenMsg(FONT_MCOLOR_LTYELLOW,
    
  •                  MSG_UI_FEEDBACK,
    
  •                  gzLateLocalizedString[3],
    
  •                  s->name);
    
  •        break;
    
  •     }
    
  •     if (FindHigherLevel(s))
    
  •     {    BeginSoldierClimbUpRoof(s);
    
  •     }
    
  •     else if (FindLowerLevel(s))
    
  •     {    BeginSoldierClimbDownRoof(s);
    
  •     }
    
  •     else if (FindFenceJumpDirection(s))
    
  •     {    BeginSoldierClimbFence(s);
    
  •     }
    
  •     break;
    
  •     } /* case 'j' */
    
  •  case 'k': BeginKeyPanelFromKeyShortcut();
    

    break;

     case 'l':
    

@@ -1561,6 +1594,18 @@
}
break;

  •  /* mgl: Clothes change */
    
  •  case 'v':
    
  •  {
    
  •  SOLDIERTYPE* const s = GetSelectedMan();
    
  •  if (!s) { break; }
    
  •  // Anyone except the robot can change clothes
    
  •  if (AM_A_ROBOT(s)) { break; }
    
  •  CyclePaletteReplacement(*s, s->VestPal);
    
  •  break;
    
  •  }
    

#ifdef JA2BETAVERSION
case ‘l’:
{
@@ -1573,6 +1618,17 @@
}
#endif

  •  /* mgl: Clothes change */
    
  •  case 'p':
    
  •  {
    
  •  SOLDIERTYPE* const s = GetSelectedMan();
    
  •  if (!s) { break; }
    
  •  // Anyone except the robot can change clothes
    
  •  if (AM_A_ROBOT(s)) { break; }
    
  •  CyclePaletteReplacement(*s, s->PantsPal);
    
  •  break;
    
  •  }
    
  •  case SDLK_F1:
     case SDLK_F2:
     case SDLK_F3:
    

SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

GNU tools seem to not be available for mingw+msys, at least in my TDM/MIngw setup they are not optional…

I guess windows and mingw+msys hardly make a optimal environment for this but the *.exe is working so I’m going to try to input those command lines in the msys console see what happens