Jump to content
Eternal Lands Official Forums
Wytter

Windows Compilation Guide

Recommended Posts

Yes that is what it says CK, just like I stated above unless you mean something else :ph34r:

 

I was just using the cal3d.dll that was in my EL dir, do I need a new one?....Edit: ah ok, I took the cal3d.dll & cal3d_extra.dll that was in um..well i dont remember how i got them I just did somehow and they worked and it works now!! Thankyou for helping! :mace:

 

Does this mean with the next client update there will be new cal3d.dll's?

Edited by Roja

Share this post


Link to post
Share on other sites

I don't think so, it's just my version may have different compile flags. Or, maybe, there might be. I honestly don't know. Anyway, those DLLs were both in the version of Cal3D which I build and released, so that's why they were dependencies.

Edited by crusadingknight

Share this post


Link to post
Share on other sites

Well there was only cal3d.dll with the current EL version(no cal3d_extra).

 

Also the new one is like 2.3mb, the old only 1.3mb in size so that's a big difference. Well I'll leave that up to you guys..I just wanted to test the new features when needed :ph34r:

Share this post


Link to post
Share on other sites

I am still getting errors when linking.

Switching to target: default
Linking console executable: C:\WINDOWS\Profiles\Eric\My Documents\ELc.exe
.objs\elc\sound.o:sound.c:(.text+0x68c): undefined reference to `_imp__alutLoadWAVFile'
.objs\elc\sound.o:sound.c:(.text+0x6de): undefined reference to `_imp__alutUnloadWAV'
.objs\elc\sound.o:sound.c:(.text+0x1b21): undefined reference to `_imp__alutInit'
.objs\elc\sound.o:sound.c:(.text+0x1f40): undefined reference to `_imp__alutExit'
collect2: ld returned 1 exit status

 

I have the OpenAl devpak version 1.0

Share this post


Link to post
Share on other sites

I wish I could give an exact account of what I did to make it work but I installed/reinstalled/uninstalled so many things I can't really say :D

Share this post


Link to post
Share on other sites

Well, it's kind of hard, since we don't even know which problems 70347 was encountering... if it's not working for him, who knows if it will work for others. I can try to clean up and merge in the stuff you (and others) managed to compile with, though...

Share this post


Link to post
Share on other sites
Guest trax

I've managed to compile and run an EL client for some time now. I'm using Codeblock because it better at handling errors then Dev C++ is. You can import everything across easy enough. I'll try and write a "How to" over the weekend to handle both compilers and barebones install using just freeware.

 

Actually it's a week later and I still haven't finished. Now I know people didn't put their hands up for this. ;-)

Edited by trax

Share this post


Link to post
Share on other sites

Will the code work on Visual C++.NET 2005? Thats what I currently have. I guess I could get that other c++ compiler, but it sounds really rough to get the project working at all. I would love to work on this project if someone could help me get it working. Until then, there's not much I can do.

 

Josh

Share this post


Link to post
Share on other sites

Will the code work on Visual C++.NET 2005? Thats what I currently have. I guess I could get that other c++ compiler, but it sounds really rough to get the project working at all. I would love to work on this project if someone could help me get it working. Until then, there's not much I can do.

 

Josh

 

I user VC++ 2005. It works for me, but there is a lot of preparation (like setting up libraries, compiling cal3d, etc.). I can send you my project file if you would like.

 

Phil

Share this post


Link to post
Share on other sites

the really short version is(copied from an older post... it was about msvc 2k3, but the differences should be minor):

 

downdload the cal3d version 0.10 source from http://cal3d.sourceforge.net/

it has MSVC project files, so just open, compile, and move the libs/headers to wherever you normally put them. I suggest making both the release and debug versions, it doesn't take much space/time, and you might want the debug version at some later date

 

<note> you need the other libs as well, of course, this comment was back when cal3d was new. the list at http://elc.berlios.de/build.php should get you going towards a good set of libs... cal3d should be the only one you need to compile yourself

 

loaded elc.dsw and said yes to recreate data files

removed all files from project

added all files to project (to clear any file-specific options set, which there are, and they were a pain)

set to compile as default rather than C++

for file-specific on cal3d_wrapper.cpp: added CAL3D_WRAPPER_EXPORTS to preprocessor line (right-click the file and go into its options)

you'll also want to look at the preprocessor options; some are out of date, some aren't used though they're pretty much a defacto default (project settings -> C/C++ ->preprocessor)

you'll likely need to update the list of libs to link against as well (options -> linker -> input). I'm not sure how out of date that list is

 

if you wish to have PNG screenshot option, then that requires installing another library to link against (libpng13.lib/dll) and a preprocessor define(PNG_SCREENSHOT)

 

if you're not sure what defines to use, and you don't mind using the newer features, you can always use the same list I do (my siggy has a link to precomp clients, which lists the defines used)

 

oh, and a gotcha... don't do a dynamic link with ogg/vorbis. use their _static versions. at least for me and msvc2k3, the data/handle can't be passed into the dll properly

Share this post


Link to post
Share on other sites

Will the code work on Visual C++.NET 2005? Thats what I currently have. I guess I could get that other c++ compiler, but it sounds really rough to get the project working at all. I would love to work on this project if someone could help me get it working. Until then, there's not much I can do.

 

Josh

 

I user VC++ 2005. It works for me, but there is a lot of preparation (like setting up libraries, compiling cal3d, etc.). I can send you my project file if you would like.

 

Phil

 

 

Sorry for taking so long to get back to you, ... yes that would be nice if you could send it to me. Do you use msn messenger? That would be the easiest way for me to get it. Also would you be willing to help me out until I get it working.

 

Thanks,

 

Josh

Share this post


Link to post
Share on other sites

Will the code work on Visual C++.NET 2005? Thats what I currently have. I guess I could get that other c++ compiler, but it sounds really rough to get the project working at all. I would love to work on this project if someone could help me get it working. Until then, there's not much I can do.

 

Josh

 

I user VC++ 2005. It works for me, but there is a lot of preparation (like setting up libraries, compiling cal3d, etc.). I can send you my project file if you would like.

 

Phil

The first problem I am having is that none of the projects for the cal3d project are compiling for visual studio 2005 on my computer. Also there are 12 projects do I need to worry about all of them or just the main Cal3d project.

 

The most common bug that I have is

 

fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directory

 

but there are also many other bugs.

 

maybe it's not worth the time getting it to work on Visual C++ 2005 express edition.

 

I was reading in another topic thread that someone deleted the installation directions for getting it to work in dev-cpp. Maybe it would be easier to get it to work for dev-cpp since that's what everyone seems to be using. When someone figures out how to get the program to compile in dev-cpp would you mind helping me get the client working for that compiler. Or is there already one up and I missed it. That seems like it would be easier than getting it to work in visual studio.

 

Josh

Share this post


Link to post
Share on other sites

 

The most common bug that I have is

 

fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directory

 

 

If I remember it right, the VC2005 Express does not come with the Platform SDK (all includes for MS libraries). You need to download it separatelly from MS. Once installed, you also need to "install it" with VC2005.

That is why you cannot find the 'afxwin.h' file.

 

If you go to the download page (HERE), take a look at point "4. Install the platform SDK". :confused:

 

Hope that helps!

Share this post


Link to post
Share on other sites

 

The most common bug that I have is

 

fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directory

 

 

If I remember it right, the VC2005 Express does not come with the Platform SDK (all includes for MS libraries). You need to download it separatelly from MS. Once installed, you also need to "install it" with VC2005.

That is why you cannot find the 'afxwin.h' file.

 

If you go to the download page (HERE), take a look at point "4. Install the platform SDK". :devlish:

 

Hope that helps!

 

 

Yeah that helps, ... I have already done this before, but there were certain files namely the afx ones that I had to add to the include directory. They changed the directory from VC++ 6 to VC++ 8.

 

Now I have 8 of the 12 projects compiling, but do I need them all to be compiling?

 

c:\temp\cal3d-0.10.0\plugins\cal3d_milk_exporter\stdafx.h(45) : fatal error C1083: Cannot open include file: 'msPlugIn.h': No such file or directory

 

that is one bug and

 

cal3d_maya_exporter.cpp

c:\temp\cal3d-0.10.0\plugins\cal3d_maya_exporter\mayainterface.h(15) : fatal error C1083: Cannot open include file: 'maya/MGlobal.h': No such file or directory

MayaInterface.cpp

 

that is another and

 

c:\temp\cal3d-0.10.0\plugins\cal3d_max_exporter\stdafx.h(43) : fatal error C1083: Cannot open include file: 'max.h': No such file or directory

 

that is another.

 

I don't have the maya 3dstudiomax, etc exporter files. Do I need these? If so where can I get these? I downloaded cal3d_exporter_binaries, but that only has dll's not header files or lib files.

Share this post


Link to post
Share on other sites

You only need the Cal3d library. Go to cal3d-0.10.0\src\cal3d and double click cal3d.dsp. This will open VC2005 and the studio will convert the project to it's format. Then just build this one project and you are done. :)

Share this post


Link to post
Share on other sites

You only need the Cal3d library. Go to cal3d-0.10.0\src\cal3d and double click cal3d.dsp. This will open VC2005 and the studio will convert the project to it's format. Then just build this one project and you are done. :P

 

Thanks, ... now I'm on to the next step.

Share this post


Link to post
Share on other sites

Hi!

 

I'm trying to compile with dev-c++ and gets this error:

 

gcc.exe -c actor_scripts.c -o actor_scripts.o -I"e:/Dev-Cpp/include"  -mwindows -lSDL -lopengl32  -llibxml2 -lSDL_net -lALut -lOpenAL32 -lvorbisfile -lvorbis -logg  -liberty -liconv -lcal3d -lcal3d_extra -lglu32  

actor_scripts.c: In function `update_all_actors':
actor_scripts.c:899: error: `resync_server' undeclared (first use in this function)
actor_scripts.c:899: error: (Each undeclared identifier is reported only once
actor_scripts.c:899: error: for each function it appears in.)

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

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

Execution terminated

 

I fixed a lot of dependencies and other error, but i can't fix this one. Could somebody help me?

 

Thank you in advance: nightw

Share this post


Link to post
Share on other sites

You seem to be missing all of the necessary defines, so you're not getting the declarations you need. You're also using the link options when you're compiling, instead of when you're linking.

Share this post


Link to post
Share on other sites

You seem to be missing all of the necessary defines, so you're not getting the declarations you need. You're also using the link options when you're compiling, instead of when you're linking.

 

Sorry for asking again, but how could i solve these problems? Maybe i'm newb to programming, but i'm interested in compiling the client myself. I didn't made any settings, just opened all the files in the source dir and set a custom makefile in the project settings(Makefile.win in the dir) and tried to compile. What i'm doing wrong?

 

Thank you again: nightw

Share this post


Link to post
Share on other sites

Chances are, you won't manage to make it compile with Makefile.win, since it's using some non-standard include pathes (which yours has changed, as I noted). Also, those settings don't come from Makefile.win- Makefile.win has

$(CC) -c actor_scripts.c -o actor_scripts.o $(CFLAGS)

but your compile method seems to be

$(CC) -c actor_scripts.c -o actor_scripts.o -I"e:/Dev-Cpp/include" $(LIBS)

Share this post


Link to post
Share on other sites

*BASH* *BASH* *BASH*

 

OW!

 

Got DevC++ to compile EL. (again)

Geez, I thought we weren't adding anymore libraries!

 

 

Compiling Eternal Lands with Dev-C++

 

Before attempting this Guide please start with a fresh CVS checkout. If you have made changes to and .c .cpp or .h files you can copy them over later. You may wish to reinstall Dev-C++ as well. I do that every time I refresh this guide.

 

Now, a step by step Dev-C++ install and compilation:

 

Get Code

 

Get code from cvs: TortoiseCVS works well, just follow directions in head post.

Go to the directory where you want to checkout the source, then right click in the explorer window, and select "CVS Checkout", and specify the CVSROOT- :pserver:anonymous@cvs.elc.berlios.de:/cvsroot/elc

the specify the module- elc

Then press OK to checkout the source.

 

Get Compiler

  • Get this version of Dev-C++.
  • Start it and go oooh, aaaah!

Set Up Compiler

Set up your development libraries by clicking these links, downloading what's there and clicking next until Finish shows up.

(Placid, there's several new libraries. I'm hosting them at my University, but I'd prefer if they were elsewhere... please?)

I just made these three DevPaks. I've tested them, but I don't trust them. Please try them and report any problems you have.

The glext.h that comes with Dev-Cpp is out of date. Save the new version in C:\Dev-Cpp\include\GL\ by right clicking on this link: glext.h

 

At this point you have two choices:

  • While you are in c:\dev-cpp\include copy the contents of the "AL" and "SDL" directories up one level to c:\dev-cpp\include (Hack way)
    OR
  • Tell Dev-Cpp that you want AL and SDL directories to be in the include path. (Right-er way)
    • Go to Tools>Compiler Options
    • Click on the Directories tab
    • Click on the C Includes tab
    • Click on the button just above the Delete Invalid button. It's next to a small empty text box. It opens a folder browser.
    • Find c:\dev-cpp\include\SDL and press OK
    • The empty textbox now has c:\dev-cpp\include\SDL in it. Press the add button.
    • Repeat the last three steps for c:\dev-cpp\include\AL (or copy and paste the directory into the empty box. Your choice.***Don't forget to "Add" the directory***)

Create Your Project

  • Now click on File > New > Project...
     
  • Make this:
    • an Empty Project
    • a C Project

    and Give it a name... I recommend el

    [*]Save the project in your elc development directory - NOT the Dev-Cpp directory that you see as a default

    [*]Click on Project > Add to Project

     

    [*]Click on the upper rightmost file or directory.

     

    [*]Press and HOLD the shift key.

     

    [*]Hit combinations of Page Down and the arrow keys until all files are selected. (Alternately click then scroll all the way to the right, hold shift and click on the last file you see.)

     

    [*]Release the shift key.

     

    [*]Locate cal3dwrapper.c and cal3dwrapper.h

     

    [*]Press the control key.

     

    [*]Click those two files.

    [*]Press the "Open" button.

    [*]Wait while Dev-C++ processes these files.

Configure Your Project

  • Press Alt + P or click Project > Project Options
  • Click the "Makefile" tab.
  • Click the "Use Custom Makefile" checkbox
  • Include Makefile.win - yu may need to navigate to your cvs directory. Typing *win in the "file name" box will make finding the file easier.
  • in your CVS checkout directory rename make.default to make.conf
  • open make.conf (use notepad) and add this line to the end
    EXTRA_LIBS=-lstdc++
    EXTRA_INCLUDES=-IC:\\Dev-Cpp\\Include\\AL -IC:\\Dev-Cpp\\Include\\SDL


Compile Your Project

  • Click Compile, or Execute > Compile, or Ctrl + F9.
  • Wait.
  • You will get some warnings (about 1 three lines long about strstr last time I wrote this ).
  • Ignore them (unless you're on the Dev team. C'mon guys... ;P )

Install Your Compiled Project

  • Copy el.exe from your CVS folder to your Eternal Lands folder (This would be c:\Program Files\Eternal Lands\ by default)
  • Back up cal3d.dll if the Eternal Lands folder you are using is your only one (Bad plan).
  • Go to c:\dev-cpp\dll
  • Copy the libcal3d.dll and libcal3d_extra.dll you found there to the same folder you copied YourProjectName.exe
  • You may have to overwrite the existing cal3d.dll file.
  • Copy alut.dll from c:\dev-cpp\lib the folder where you copied the previous 3 files.

Run. Enjoy.

 

Jun. 12/07 update: Changed instructions to handle changes brought on by EYE_CANDY. Made DevPaks for libraries that needed them. (glext.h doesn't have one cause its not worth the effort.)

Edited by emajekral

Share this post


Link to post
Share on other sites

[*]Paste this

-DWINDOWS -Wall -DELC -DNEW_FRUSTUM -DBUG_FIX_3D_OBJECTS_MIN_MAX -DWIDGETS_FIX -DNEW_TEX -DNETWORK_THREAD -DNEW_ACTOR_ANIMATION -DCOMMAND_BUFFER -DOPTIONS_I18N

i

 

Technically, that should be

-Wall -DELC -DNEW_FRUSTUM -DAUTO_UPDATE -DBUG_FIX_3D_OBJECTS_MIN_MAX -DCOUNTERS -DNEW_TEX -DNEW_ACTOR_ANIMATION -DOPTIONS_I18N

Several of the definitions have been obsoleted since the list was first created.

 

(For anyone interested, a full list of all options can be found using grep "#ifdef" *.[ch] | gawk '{ print $2 }' | sort | uniq in the el source directory.)

 

BTW, why aren't you using the SDL and SDL_net DevPaks? (They were some of the first in the respository: http://devpaks.org/details.php?devpak=12 and http://devpaks.org/details.php?devpak=124 .)

Edited by crusadingknight

Share this post


Link to post
Share on other sites
grep "#ifdef" *.[ch] | gawk '{ print $2 }' | sort | uniq
that assumes that there are no #ifndef-only references, and also lists the header defines, platform stuff, etc. the one I use is
@grep -h -E "#(ifdef|ifndef)" elc/*c elc/*h elc/*cpp|gawk "{print $2}"|sed "/^_/g"|sed "/_H_*/g"|sed "/^GL/g"|sort|uniq

(from the parent dir, otherwise you remove the elc/ part, naturally)

this is also somewhat windowsified... such as @ to not print the line, quotation marks, etc

Share this post


Link to post
Share on other sites
grep "#ifdef" *.[ch] | gawk '{ print $2 }' | sort | uniq
that assumes that there are no #ifndef-only references, and also lists the header defines, platform stuff, etc. the one I use is
@grep -h -E "#(ifdef|ifndef)" elc/*c elc/*h elc/*cpp|gawk "{print $2}"|sed "/^_/g"|sed "/_H_*/g"|sed "/^GL/g"|sort|uniq

(from the parent dir, otherwise you remove the elc/ part, naturally)

this is also somewhat windowsified... such as @ to not print the line, quotation marks, etc

The idea was to keep it simple - plus, you forgot about #if [!]defined( ) [(&&|\|\|) [!]defined( )], and so forth. :devlish: I will remember your script for future reference, handy stuff. (Just "{print $2}" will always print the second argument to the bash script, so it needs '{ print $2 }' on *nix.)

Edited by crusadingknight

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.

×