How to compile ET with MinGW


(Alan) #1

You can find a guide to compile ET with the MinGW compiler.
http://header.chez.tiscali.fr/et/

Unfortunately, the cgame DLL doesn’t run properly.
Please send me a mail if you find a solution.

Alan


(SCDS_reyalP) #2

If you could be more specific than “doesn’t run properly” we might be able to offer some suggestions.
does it crash, fail to load, or do something else ?


(Alan) #3

I think the engine fails to load cgame DLL, because ET freezes just at the end of the game launch (just before you can see the map).
But i don’t know how to trace the execution under windows (under Linux it is more easy because i can see the console logs, even if ET crashes).

I have done some changes on the ET source code :

  • cg_panelhandling.c is not added to cgame DLL (i think he isn’t needed to build cgame.dll)
  • the following function into q_math.c has been modified :
long myftol( float f ) {
     static int tmp;
     tmp = (int) f;
     return (long) tmp;
}

(Rain) #4

To figure out what’s going wrong, your best bet would probably be to write debugging info to a text file (fopen, fprintf, fclose for the really simple don’t-keep-track-of-an-open-fd approach.) If it actually crashes, drmingw will probably prove useful (the default windows debugger doesn’t know how to read mingw’s debugging information.)


(hemebond) #5

When I load my mod (just a straight compile after following Alan’s instructions), I can play fine. I don’t get any crashes. Does this mean your instructions are fine now Alan?


(Alan) #6

fopen crashes under windows. Thanks for drmingw, i’ll try the debugging tool when i have time. I am very buzy for now.

Mmh, you are lucky. I don’t have made changes :slight_smile:
What is your conf ?

Does that work for some other persons ?


(Rain) #7

:huh: That’s…not right. Perhaps you have larger problems. :smiley:


(hemebond) #8

Well, I followed the instructions but all I get from MSYS is

$ make game
make: `game' is up to date.

Any ideas?


(jaybird) #9

Perhaps do a ‘make clean’ first?


(hemebond) #10

Oh how weak. That gave me a better error message and I was able to deduce that I had put makefile into the wrong directory (et/src instead of et/).

Thanks jaybird.


(jaybird) #11

Yep :slight_smile:


(RayBan) #12

im going to bump this old thread.

i have a small idea i want to mess around with but trying to follow the
“How to compile Enemy Territory with MinGW” by alan has got me confused
on the part “Modify the file WET_Source\src\game\q_math.h, line 577”

keep in mind im relatively new to c++, howver i do have 2005 express
and the platform sdk all setup proper and it works fine for all the little
programs i have tried. i also have dev c++ working…

but my question is, where is the q_math.h header file? i do not have it in
my wet_source… ( i downloaded the wet_source a few years back to hunt
for quaked entities to play with ) so its an older copy.

i also have the ET_SDK installed and its not in there either? has something
been changed?


(Sauron|EFG) #13

q_math.c (which he even says in this thread = typo in the guide).


(RayBan) #14

lol, ok… my bad…

however in my defense… ok… i have none…

but i did do a search after for q_math.h which brought up several
threads so i assumed the file must have existed, or at least ppl have discussed it before.

thanks sauron.


(jaybird) #15

I don’t think you have to do anything to the source at this point to cross compile it. I think it just works out of the box.


(RayBan) #16

i couldnt compile it before i made the change above to math.c
it does compile now, however… i can get into the game… but it crashes
shortly after.

compiling it stock without the change to math.c did give me errors.

but it could also be my et install, i have several on my drives, and the one
im using for the mymod test is over 2 gig because i use it for map testing
and creation… i’ll do a fresh clean install and give it another test.

however i cant see my bloated et folder as the cause, since it’s relatively
clean and adding a mod folder to test a mod shouldn’t cause any problems.


(nUllSkillZ) #17

You should try the latest version of the SDK.

My guess:
Your mod is incompatible with the et.exe you use.


(RayBan) #18

thanks nULLSkillZ,

just reinstalled et to a fresh folder, patched and now downloading latest sdk.


(RayBan) #19

well, got it all to work… at least i think i do… everything compiles proper,
i can see mymod in the mod’s area of et, it loads fine and i can enter the game.

is there any small test i can do to make shure its mymod thats running?

for example i changed the CG_AddDirtBulletParticles values for the bullets
from the guns to 512 for height and width… however in game they look and
remain the same.

even if i goto the mods menu and select mymod and enter the game, still
the same.

is there any small test , something minor to change to see if the mods
running? any recomendations?


(kamikazee) #20

You could open g_cmds.c and add this to the last function in the file: (make sure it’s before the final “else” part though)

	} else if (Q_stricmp (cmd, "confirmmod") == 0) {
		trap_SendServerCommand( clientNum, va("print \"This is %s
\"", GAMEVERSION ) );
		return;

Not only will this confirm that you are running your mod, it also prints out the GAMEVERSION constant set in g_local.h.