Announcement: Be excellent to each other.


Caravel Forum : Caravel Boards : Development : A guide to compiling DROD on windows
New Topic New Poll Post Reply
Poster Message
Andy101
Level: Master Delver
Rank Points: 222
Registered: 07-22-2005
IP: Logged

File: Metakit.zip (155.7 KB)
Downloaded 71 times.
License: Public Domain
From: Not specified
icon A guide to compiling DROD on windows (+4)  
A while ago, when I finally managed to compile DROD for myself, I said that I'd get round to writing a guide for other people to follow, and here it is.

The following is a guide to compiling DROD on windows using Dev C++:

1) Download Dev C++ Version 5 beta from here.

2) Install Dev C++ selecting the 'Full Install' option.

3) Download the latest DROD source code from here.

4) Extract the DROD source zip file.

From this point on I will assume that Dev C++ is installed in C:\Dev-Cpp and the DROD source unzipped to C:\DROD so you may need to change file names that I mention later to match where the two are located on your computer.

5) In Dev C++ go to the tools option and select 'Check for Updates/Packages...'. Now select the 'devpaks.org Community Devpaks' server and check for updates. Then download and install the following:
SDL 1.2.11
SDL_ttf 2.0.8
zlib 1.2.3
libcurl 7.14.0_nossl (7.15.2 is the one being used now)
Expat 2.0.0
FMOD 3.75
libjpeg 6b-4
libpng 1.2.8 (1.2.12 is being used now)
WebUpdateMirrorsList

NB: The versions of the libraries used by DROD are not all available for download through Dev C++. It is possible to find the appropriate versions by a quick search of the internet. On the other hand, as far as I know, using the slightly older versions that can be downloaded through Dev C++ does not cause any problems.

6) Now select the 'Dev-C++ primary devpak server' and download and install 'MinGW runtime'.

7) Now download the file attached to this post which contains various bits of the metakit library that we require. Decompress the file and put mk4.h and mk4.inl in C:\Dev-Cpp\include and libmk4.a in C:\Dev-Cpp\lib.

8) In Dev C++ select the 'file' menu then select 'new' and create a new project. Select the empty project option and name the project DROD.

9) Right click on your DROD project, which should now have appeared in a panel on the left of the screen, and create the following new folders:
BackEndLib
DROD
DRODLib
FrontEndLib

10) Right click on each folder, select 'Add to project' and add all the source files (.cpp and .h) from the appropriately named folder in C:\DROD\DROD20Source. However there is one exception, we don't want to add 'Copy of Sound.cpp' from FrontEndLib.

11) Now go to the 'Project' menu and select 'Project Options'. Under the 'General' tab in the icon section add the icon at C:\DROD\DROD20Source\DROD\Res\drod.ico. You also need to set the project type to 'Win32 GUI'.

12) Under the 'Parameters' tab add “-D__GNUWIN32__ -W -fexceptions -DUNICODE -DNDEBUG -DWIN32 -D_WINDOWS -D_MBCS -Dmain=SDL_main” (bubt without the quotes) to the compiler and c++ compiler command line options. Then add “-lmingw32 -lSDLmain -lSDL -luser32 -lshell32 -lSDL_ttf -ljpeg –lpng –lexpat –lmk4 –lcurldll –lz –lfmod” (again without the quotes) to the linker options.

13) Under the 'Directories' tab add the folders C:\Dev-Cpp\include\SDL, C:\Dev-Cpp\include\FMOD and C:\DROD\DROD20Source to the include directories and C:\DROD\DROD20Source\DROD\Res to the resource directories.

Now you're nearly ready to compile DROD but we need to make a few changes to the source code first.

14) In BackEndLib\Assert.h find the lines:
# define ASSERT(exp) _ASSERT_VOID_CAST( (exp) ? 0 : AssertErr(__FILE__,__LINE__,#exp) )
# define ASSERTP(exp, desc) _ASSERT_VOID_CAST( (exp) ? 0 : AssertErr(__FILE__,__LINE__,(desc)) )
and change them to:
# define ASSERT(exp) _ASSERT_VOID_CAST( (exp) ? (void) 0 : AssertErr(__FILE__,__LINE__,#exp) )
# define ASSERTP(exp, desc) _ASSERT_VOID_CAST( (exp) ? (void) 0 : AssertErr(__FILE__,__LINE__,(desc)) )
and in BackEndLib\Wchar.h change the line:
typedef WCHAR_t WCHAR; //wc, 16-bit UNICODE character
to:
typedef wchar_t WCHAR; //wc, 16-bit UNICODE character

15) Now there's just one thing left to change, wherever something of the form {{'E'},{'x'},{'a'},{'m'},{p'},{'l'},{'e'},{0}} appears in the code we need to replace it with {'E','x','a','m',p','l','e',0}. Unfortunately I know of no quick and easy way of doing this so it's time to compile DROD and replace these whenever we encounter them.

16) Press Ctrl + F9 or the compile button to start compiling DROD. Whenever you encounter an error of the form “brace-enclosed initializer used to initialize `const WCHAR'”, which hopefully will be the only errors you encounter, then simply double click on the error (they appear in the compiler output at the bottom of the window) and change the offending code. Then press Ctrl + F9 or the compile button to continue.

NB: Whilst compiling you will encounter warnings in the compiler output but it is safe, I think, to ignore these.

17) Now hopefully we have a freshly compiled DROD.exe in the same folder as you saved the project and all we need to do is put it in a suitable location so it can run. I suggest making a copy of your current DROD directory and simply replacing the executable. Due to the libraries that we compiled with your new DROD.exe requires different .dlls from the ones you already have. It does not need the following:
mk4vc60.dll
libexpat.dll
but does need:
jpeg62.dll
libpng13.dll
zlib1.dll
Click on the above links to download the files.

If nothing's gone wrong then you should be able to start your new executable and be greated by a fully functioning DROD. If you have any problems following the above instructions then feel free to post here and quiz me about them.

Andy

____________________________
"True perfection has to be imperfect"

[Last edited by Andy101 at 09-16-2006 12:22 PM : Added note about 3rd party libs]
09-15-2006 at 10:37 PM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
Pinnacle
Level: Smitemaster
Avatar
Rank Points: 1129
Registered: 06-10-2004
IP: Logged
icon Re: A guide to compiling DROD on windows (0)  
Can this be stickied?

____________________________
Once (adv.): Enough.
Twice (adv.): Once too often.
~Ambrose Bierce, The Devil's Dictionary
09-15-2006 at 11:53 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
coppro
Level: Smitemaster
Rank Points: 1308
Registered: 11-24-2005
IP: Logged
icon Re: A guide to compiling DROD on windows (0)  
Hmm...

If only Mike would make those changes to the 2.15 and 3.0 codes, then anyone could compile/hack at will!
09-16-2006 at 12:30 AM
View Profile Show all user's posts Quote Reply
Pilchard VIII
Level: Smiter
Rank Points: 392
Registered: 01-21-2006
IP: Logged
icon Re: A guide to compiling DROD on windows (0)  
Yes, I have no idea what he was on about, but it was still great!

____________________________
The DROD Dragon
09-17-2006 at 06:14 AM
View Profile Send Private Message to User Send Email to User Show all user's posts This architect's holds Quote Reply
coppro
Level: Smitemaster
Rank Points: 1308
Registered: 11-24-2005
IP: Logged
icon Re: A guide to compiling DROD on windows (0)  
Suddenly, the problem becomes apparent.

There is no Devpak for fmod 3.7.5 or sdl_ttf 2.0.8!
There are 3.7.4 and 2.0.7 respectively.

Aah. DROD can't find the data files now. Great. Something's wrong with my file handlers.

[Last edited by coppro at 10-01-2006 05:11 PM]
10-01-2006 at 05:06 PM
View Profile Show all user's posts Quote Reply
gamer_extreme_101
Level: Smitemaster
Avatar
Rank Points: 1939
Registered: 03-07-2004
IP: Logged
icon Re: A guide to compiling DROD on windows (0)  
Anybody have the SDL devpak on their computer? For some unknown reason, the only mirror that holds that devpak is down, and I'm unable to find an alternate download for it.

____________________________
--That guy with a million different aliases since he doesn't like this name anymore.
10-02-2006 at 09:39 PM
View Profile Send Private Message to User Send Email to User Visit Homepage Show all user's posts This architect's holds Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5056
Registered: 02-04-2003
IP: Logged
icon Re: A guide to compiling DROD on windows (0)  
gamer_extreme_101 wrote:
Anybody have the SDL devpak on their computer? For some unknown reason, the only mirror that holds that devpak is down, and I'm unable to find an alternate download for it.
Is this what you need? (Two bundles enclosed)

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.
10-02-2006 at 10:08 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
coppro
Level: Smitemaster
Rank Points: 1308
Registered: 11-24-2005
IP: Logged

File: SDL-1.2.11-2ea.DevPak (581.9 KB)
Downloaded 77 times.
License: Public Domain
icon Re: A guide to compiling DROD on windows (+3)  
Here's the devpak.

[Last edited by coppro at 10-02-2006 11:49 PM]
10-02-2006 at 11:47 PM
View Profile Show all user's posts Quote Reply
JDAdams
Level: Delver
Rank Points: 33
Registered: 01-04-2008
IP: Logged
icon Re: A guide to compiling DROD on windows (+2)  
Sorry to resurrect such an old thread, thought it may be useful to note that the FMOD 3.72 devpak is available from http://belzel.free.fr/addons/ and appears to work fine - 3.74 and onward seem to have vanished off the face of the Earth :(

Oh, and many thanks for this post, so helpful! I now have JtRH working in TCB, yay! :thumbsup

To compile a 3.0 build, you'll also require the Ogg Vorbis and Theora devpaks at http://old.devpaks.org/show.php?devpak=141 and http://sourceforge.net/project/showfiles.php?group_id=94270&package_id=156891&release_id=339163 respectively. You will also need to add "-ltheora -lvorbis -logg" (without quotes) to the list to the "linker" command-line options.

[Last edited by JDAdams at 01-14-2008 03:46 PM]
01-13-2008 at 04:49 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
silver
Level: Smitemaster
Rank Points: 915
Registered: 01-18-2005
IP: Logged
icon Re: A guide to compiling DROD on windows (0)  
01-14-2008 at 08:24 AM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
New Topic New Poll Post Reply
Caravel Forum : Caravel Boards : Development : A guide to compiling DROD on windows
Surf To:


Forum Rules:
Can I post a new topic? No
Can I reply? No
Can I read? Yes
HTML Enabled? No
UBBC Enabled? Yes
Words Filter Enable? No

Contact Us | CaravelGames.com

Powered by: tForum tForumHacks Edition b0.98.8
Originally created by Toan Huynh (Copyright © 2000)
Enhanced by the tForumHacks team and the Caravel team.