Jump to content
Eternal Lands Official Forums
Wytter

Windows Compilation Guide

Recommended Posts

Hey, thanks for updating the windows compile guide. Quick 2 questions related to using the Makefile.win as opposed to DevC++'s way of doing things:

1: How are you getting the EL icon associated with the resulting exe file?

2: My resulting exe is 7MB in size as opposed to the distributable 2MB. Are you able to strip symbols?

Share this post


Link to post
Share on other sites

I have to manually add the icon to the exe using windres to compile the icon to a .o file, manually link the .o into the exe, I then need to run strip.exe on the resulting exe.

 

Sort of longwinded but I have it all in a batch file, when I get back to my PC I will edit this post with the commands I use.

Share this post


Link to post
Share on other sites

I don't know if I am going to put this in the official guide but this does the trick:

 

Change the instructions for the $(EXE) target in Makefile.win to this:

$(EXE): main.o $(TMP_LIB)
windres elc_private.rc elc_private.o
$(LINK) $(CFLAGS) $< -L. -lelc $(LDFLAGS) elc_private.o -o $(EXE)
strip -s $(EXE)

Please note that the leading whitespace on each of those lines should be a <tab> character not spaces.

If you wish to use the debugger comment out the strip line like this

#	strip -s $(EXE)

 

@Placid: Done

Edited by emajekral

Share this post


Link to post
Share on other sites

I tried with all new revisions, I get this:

 

Compiler: Default compiler

Executing make...

make.exe -f "Makefile.win" all

gcc.exe -c 2d_objects.c -o 2d_objects.o -I"C:/Dev-Cpp/include"

 

gcc.exe -c 3d_objects.c -o 3d_objects.o -I"C:/Dev-Cpp/include"

 

gcc.exe -c actor_scripts.c -o actor_scripts.o -I"C:/Dev-Cpp/include"

 

actor_scripts.c: In function `update_all_actors':

actor_scripts.c:988: error: `resync_server' undeclared (first use in this function)

actor_scripts.c:988: error: (Each undeclared identifier is reported only once

actor_scripts.c:988: error: for each function it appears in.)

actor_scripts.c: In function `add_command_to_actor':

actor_scripts.c:1010: error: `cant_add_command' undeclared (first use in this function)

 

make.exe: *** [actor_scripts.o] Error 1

 

Execution terminated

Share this post


Link to post
Share on other sites

If you modify a file intentionally or unintentionally then a CVS update will not fix that file. It marks it M for modified instead of U for update. If you ever do a build without including the Makefile.win, Dev-C++ will overwrite the one from CVS and it will never be fixed. Possibly simply deleting the Makefile.win and then updating will resolve many problems.

 

The directions I have posted are not intended to resolve deep set problems, they are meant to be used from scratch. Every time I update them I uninstall Dev-C++, delete my CVS checkout directory and follow the whole thing through 3 or 4 times noting problems I encounter along the way.

Edited by emajekral

Share this post


Link to post
Share on other sites

Deleted and re-checked out, this is what I got:

 

Compiler: Default compiler

Executing make...

make.exe -f "Makefile.win" all

 

gcc -march=i686 -Wall -O0 -ggdb -pipe -DWINDOWS -DELC -DAFK_FIX -DALPHA_ACTORS -DATI_9200_FIX -DAUTO_UPDATE -DCOUNTERS -DCUSTOM_LOOK -DCUSTOM_UPDATE -DEYE_CANDY -DFONTS_FIX -DFUZZY_PATHS -DIDLE_FIX -DMASKING -DNEW_ACTOR_ANIMATION -DNEW_ALPHA -DNEW_TEX -DNOTEPAD -DOPTIONS_I18N -DSFX -DSIMPLE_LOD -DUSE_INLINE -DZLIB -fno-strict-aliasing -IC:\\Dev-Cpp\\Include\\AL -IC:\\Dev-Cpp\\Include\\SDL main.o -L. -lelc -lstdc++ -lpng -lz -llibxml2 -lSDL_net -lSDL_image -lsdl -lalut -lopenal32 -lglu32 -lopengl32 -liconv -lvorbisfile -lvorbis -logg -lcal3d -lm -lstdc++ -o el.exe

 

Execution terminated

Edited by fyrrflyy

Share this post


Link to post
Share on other sites

gcc -march=i686 -Wall -O0 -ggdb -pipe -DWINDOWS -DELC -DAFK_FIX -DALPHA_ACTORS -DATI_9200_FIX -DAUTO_UPDATE -DCOUNTERS -DCUSTOM_LOOK -DCUSTOM_UPDATE -DEYE_CANDY -DFONTS_FIX -DFUZZY_PATHS -DIDLE_FIX -DMASKING -DNEW_ACTOR_ANIMATION -DNEW_ALPHA -DNEW_TEX -DNOTEPAD -DOPTIONS_I18N -DSFX -DSIMPLE_LOD -DUSE_INLINE -DZLIB -fno-strict-aliasing -IC:\\Dev-Cpp\\Include\\AL -IC:\\Dev-Cpp\\Include\\SDL main.o -L. -lelc -lstdc++ -lpng -lz -llibxml2 -lSDL_net -lSDL_image -lsdl -lalut -lopenal32 -lglu32 -lopengl32 -liconv -lvorbisfile -lvorbis -logg -lcal3d -lm -lstdc++ -o el.exe

 

That means everything worked perfectly! Yourr executable is el.exe. Copy it to a game directory double click and play!

Edited by emajekral

Share this post


Link to post
Share on other sites

Thanks for that Emajekral. I've now added the following to the server that were previously not available:

  • png picture format library
  • jpeg picture format library
  • SDL image support
  • SDL network support
  • OpenAL sound library
  • OpenAL sound library utilities
  • glext.h

Share this post


Link to post
Share on other sites
Let me know if there are any problems with the directions. I will monitor this thread for about a week. Expect min. 24hr turnaround - I'm a busy guy.

I've just followed these instructions and built EL under Windows quite happily. Good work.

 

One comment (and its not a problem with your directions I don't think), you can unselect the eye candy C++ wrapper files as well (as you do with the cal3d C++ wrapper).

 

/edit:

 

It might be worth adding this to your instructions (until it is added to CVS)

Edited by Torg

Share this post


Link to post
Share on other sites
you can unselect the eye candy C++ wrapper files as well

 

Actually I believe you can now leave the cal3d wrapper in the selection list. I'll test that and remove that instruction if it isn't needed anymore. It was only there to avoid the hassle of making exceptions and compile rules for C++ when Dev-C++ was generating makefiles.

 

It might be worth adding this to your instructions

 

I may add that change and the one to add an icon to the .exe (and maybe the one to strip binaries too) to a "Advanced Aspects and Refinements" section. I'll think about it.

Share this post


Link to post
Share on other sites

A quick note - and something I'll add to my How to soon.

 

To get Dev-C++ to compile without the provided makefile paste this into BOTH the compiler and C++ compiler boxes in the parameters tab in the project options window.

 

-DWINDOWS -DELC -DAFK_FIX -DALPHA_ACTORS -DATI_9200_FIX -DAUTO_UPDATE -DCOUNTERS -DCUSTOM_LOOK -DCUSTOM_UPDATE -DEYE_CANDY -DFONTS_FIX -DFUZZY_PATHS -DIDLE_FIX -DMASKING -DNEW_ACTOR_ANIMATION -DNEW_ALPHA -DNEW_TEX -DNOTEPAD -DOPTIONS_I18N -DSFX -DSIMPLE_LOD -DUSE_INLINE -DZLIB

 

Paste this into linker:

-lstdc++ -lpng -lz -llibxml2 -lSDL_net -lSDL_image -lsdl -lalut -lopenal32 -lglu32 -lopengl32 -liconv -lvorbisfile -lvorbis -logg -lcal3d -lm

 

and make sure you include all .c .cpp and .h code in your project... even the stuff in subdirectories. Especially make sure to look in the eye_candy and io sub directories.

 

If you are in doubt, try the provided makefile once, then look at the compile log. From the final compile line copy all the -D things into compile options, and all the -l (little L) things into linker options. Check out make.defaults for more options. Any FEATURES can be added to the compiler options with -D in front of them.

Edited by emajekral

Share this post


Link to post
Share on other sites

Can someone help me? I keep getting this error:

 

 

C:\Dev-Cpp\Bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\mingw32\bin\ld.exe: cannot find -lelc

collect2: ld returned 1 exit status

 

make.exe: *** [EternalLands.exe] Error 1

 

Execution terminated

 

 

 

I'm using the compile options Emajekral posted above.

Share this post


Link to post
Share on other sites

That's what I get for not doing a proper compile guide. I tested that one last night. leave -lelc out of the list you paste into linker (post above has been edited apropriately.)

Share this post


Link to post
Share on other sites

Ok I took that out of the linker, now I get this error:

 

elc/sound.o(.text+0x482):sound.c: undefined reference to `alutLoadMemoryFromFile'

 

elc/sound.o(.text+0x14ae):sound.c: undefined reference to `alutInitWithoutContext'

elc/map.o(.text+0x280):map.c: undefined reference to `load_map'

collect2: ld returned 1 exit status

 

make.exe: *** [EternalLands.exe] Error 1

 

Execution terminated

Share this post


Link to post
Share on other sites

I'm not sure about the sound errors but the load_map error will be fixed if you look in the subdirectory called io and add all the code files you see there to your project.

 

load_map is in elc/io/map_io.?

 

Make sure you look in all the folders in your cvs checkout and include any .cpp, .c, and .h files you see.

 

alutLoadMemoryFromFile is in the alut.lib library file. Make sure you have installed the freealut devpak and have added

 

C:\Dev-Cpp\include\AL

and

C:\Dev-Cpp\include\SDL

 

to your include directories.

 

If you haven't done so before now Rebuild All (grey broken window icon)

 

_____

 

Perhaps the Makefile is easier? This is why I haven't put these instructions in my guide yet.

Edited by emajekral

Share this post


Link to post
Share on other sites

Note on the sound errors, people who get an error there when the compile is otherwise correct (including link instructions) should try to toggle ALUT_WAV; as this define changes the way WAV files are loaded and OpenAL is initialised.

Share this post


Link to post
Share on other sites

Thanks guys,

 

ttlanhil, how do I toggle that? I still get the AL errors

 

elc/sound.o(.text+0x482):sound.c: undefined reference to `alutLoadMemoryFromFile'

 

elc/sound.o(.text+0x14ae):sound.c: undefined reference to `alutInitWithoutContext'

collect2: ld returned 1 exit status

 

make.exe: *** [EternalLands.exe] Error 1

Share this post


Link to post
Share on other sites

Assuming dev-cpp isn't completely different (I haven't used it, but what I've heard suggests that it's not too different); edit make.conf and either add or remove the octothorpe (#) in front of ALUT_WAV

Share this post


Link to post
Share on other sites

Ok, the # was there so I removed it, compiled and got the same errors. Then I thoguht maybe I need to add -DALUT_WAV to the compile options? So I tried that, and go this error:

 

elc/sound.o(.text+0x14ae):sound.c: undefined reference to `alutInitWithoutContext'

collect2: ld returned 1 exit status

 

make.exe: *** [EternalLands.exe] Error 1

 

Execution terminated

Share this post


Link to post
Share on other sites

Take a look in C:\Dev-Cpp\lib\

 

if you don't see alut.lib and alut.dll in that directory then you need to download this file and install it with the Dev-C++ devpak manager.

 

freealut-devel

 

you may need to look at the list of packages listed under Tools>Package Manager to see if there's a conflicting version of alut installed.

 

Roja, I changed some of the libraries and many of the instructions for setting up Dev-C++. Unless you've followed the corrected directions from this link closely in the last week you will have undefined reference errors.

Edited by emajekral

Share this post


Link to post
Share on other sites

I had been able to compile the client for this past update.

I did go through all of your instructions and followed them(except like redownloading the compiler)

I think now I'm just screwing stuff up though. If I had old libraries installed, would I have to uninstall them before installing new ones?

 

Also, when I check to use the custom Make.Win file, I get this error:

Compiler: Default compiler

Executing make clean

make.exe: *** No rule to make target `make.defaults', needed by `make.conf'. Stop.

 

Execution terminated

 

It won't even start compiling..just gives this error. But I never used a custom make.win before..if i don't use it I get the alut errors posted above.

 

And sometimes i get this error:

C:\Dev-Cpp\Bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\mingw32\bin\ld.exe: cannot find -lelc

collect2: ld returned 1 exit status

 

make.exe: *** [EternalLands.exe] Error 1

 

ughh..forget it. Every single time i try something different i get a different error. This is driving me nuts. Can someone please send me a compiled client? cause i really really need to use that new character map with light in it.

Share this post


Link to post
Share on other sites

This thread is getting really full and big. I'm closing it..going to start a new one for helping anyone compile.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

  • Recently Browsing   0 members

    No registered users viewing this page.

×