 |
ivanforum Forum for Iter Vehemens ad Necem
|
| View previous topic :: View next topic |
| Author |
Message |
TheFallenOne222 gibberling
Joined: 03 Apr 2005 Posts: 166
|
Posted: Mon Apr 11, 2005 12:05 am Post subject: Compiling the Source - A Guide for Windows Users |
|
|
Many of us around the forums have been having some major troubles compiling the source for IVAN, and it has been hindering our ability to do anything with it. Therefore, I figured I'd write this guide on how to get it to compile in MinGW. Feel free to post a guide as to how to get it up and running in other compilers or operating systems, and I'll add it to the tutorial.
First things first - You'll need to get yourself a copy of MinGW. The newest version can be found on this site. Download the newest release candidate. It should be at the top of the page, listed under "Candidate". All you need is the release file, which should be under "MinGW" in that section. No need to worry about the binutils. The newest candidate as of writing this is 3.2.0-rc-3.
Choose your installation directory. After you get MinGW installed, go here to download the SDL libraries. Look under the "Development Libraries" section. Under the "Win32" subsection there should be a release listed with "(Mingw32)" beside it in brackets. That is the release you want, so download that.
Once you download and unzip the SDL libraries (Unzip them to any directory, you only need to grab one thing out of the library), open up Windows Explorer and go to where you unzipped the SDL libraries. Copy the "lib" and "include" directories to the MinGW32 folder, telling it to overwrite any existing files in that directory.
Now you have MinGW32 setup to compile the sourcecode for IVAN. Now, if you don't have it already, go here and download the IVAN source files, ZIP format. Extract them to a directory that is convenient for you.
There are two choices at this point - Either you may modify the makefile for IVAN's sourcecode, or you can add the MinGW bin directory to your path. The easier method is probably adding MinGW to your system's path. Feel free to skip to the section that you would rather do.
Choice 1 - Modifying the Makefile
Now, reopen Windows Explorer and go to the directory where you extracted the IVAN sourcecode. Look for the file "ivanmgw.mak". Rightclick on that file and choose "Edit". At the top of the file, there should be a section like this:
| Code: |
# Iter Vehemens ad Necem makefile for MinGW environment
# Copyrights (C) Timo Kiviluoto / IvanDev 2002-2004
CC = g++ -o
FeLibDIR = FeLib
FeLibGCH =
#FeLibGCH = ...
FeLibOBJ = ...
IVANDIR = Main
IVANBIN = IVAN.exe
|
Change the "FeLibDIR" and "IVANDIR" entries so that they point to where your sourcecode actually is. So, for example, I have my sourcecode at D:ProgrammingIVANivan-0.50, so my entries would look like:
FeLibDIR = D:ProgrammingIVANivan-0.50FeLib
IVANDIR = D:ProgrammingIVANivan-0.50Main
Once you have done that, you're ready to compile. Open up a DOS prompt (Go to your "Run" menu and type "cmd" and then hit Okay) and navigate to where you installed MinGW32. If you have no experience with a DOS prompt, don't worry, I'll explain what I mean. Here's an example... If you installed it at D:ApplicationsMinGW, just type this in at the DOS prompt:
D: <hit enter>
cd ApplicationsMinGW <hit enter>
The "prompt" left of where you are typing should then change to the directory that are currently in every time you type a command. If not, make sure you entered it correctly.
Then, type in:
cd bin
This will take you to the "bin" subdirectory.
From there, type this command in:
mingw32-make -f <directory where source is>ivanmgw.mak
So, for example, with my install of the source at D:ProgrammingIVANivan-0.50, I would type this:
mingw32-make -f D:ProgrammingIVANivan-0.50ivanmgw.mak
Let that run, and presto! You should have a compiled copy of your source.
It should create an "IVAN.exe" file inside of the BIN subdirectory of your MinGW install. So, for me, it would be at this directory:
D:ApplicationsMinGWbinIVAN.exe
Choice 2 - Adding the BIN directory to your path
Rightclick on "My Computer" and go to Properties (If you don't have a "My Computer" icon, you can go to the Start Menu --> Control Panel --> System instead - You may have to switch to "Classic View" in the Control Panel before you see "System"). From there, choose the "Advanced" tab, and then click "Environment Variables" at the bottom.
At the bottom of the dialog that pops up should be a section labelled "System Variables". Scroll down until you find the "Path" variable and doubleclick on it. Go to the "Variable Value" textbox in the dialog that opens, and, at the beginning of the path, enter this:
<MinGW Path>bin;
So, for example, if I had MinGW installed at D:ApplicationsMinGW, I would put this at the beginning:
D:ApplicationsMinGWbin;
Once you have done that, hit "OK" on all of the dialogs you have open. You are now ready to compile IVAN.
Open up a DOS prompt (Go to your "Run" menu and type "cmd" and then hit "OK") and navigate to where you extracted the IVAN source. If you have no experience with a DOS prompt, I'll explain what I mean. Here's an example... If you installed it at D:ProgrammingIVANivan-0.50, just type this in at the DOS prompt:
D: <hit enter>
cd ProgrammingIVANivan-0.50 <hit enter>
The "prompt" left of where you are typing should then change to the directory that are currently in every time you type a command. If not, make sure you entered it correctly.
Then, type in:
mingw32-make -f ivanmgw.mak
Congratulations, that should compile the source for you, and it should come out as "IVAN.exe" inside of your IVAN source directory.
Good luck!
If any of you have any thoughts or questions on this, or would like a tutorial for another development tool, post here and let me know and I'll try to put something together. As well, if you would like to contribute something, feel free to do so and I will add it to this post.
EDIT: Added holybanana's method.
Last edited by TheFallenOne222 on Mon Apr 11, 2005 10:54 pm; edited 3 times in total |
|
| Back to top |
|
 |
Lege mutant ass

Joined: 07 Apr 2005 Posts: 99 Location: I ride the yellow dropship!
|
Posted: Mon Apr 11, 2005 3:33 pm Post subject: |
|
|
| Sticky! |
|
| Back to top |
|
 |
holybanana Party Chairman
Joined: 04 Jan 2005 Posts: 155 Location: Above Valpurus
|
Posted: Mon Apr 11, 2005 10:13 pm Post subject: |
|
|
Thanks for a comprehensive guide. However, IMHO it is easier not to modify our makefile, but instead add your mingw's bin directory to the environment variables, like this
| Quote: |
| You can freely rename or move this top-level directory, provided you update your system's path environment variable (on Windows 2000, right-click My Computer --> Properties --> Advanced --> Environment Variables). For our example, we'd insert: C:mingwbin, preferrably at the beginning of the path. See the install instructions with MinGW for more. |
from http://www.spacejack.org/games/mingw/
This is the same as adding a path to autoexec.bat in old windozes.
This way you can compile in IVAN's directory using the command
mingw32-make -f ivanmgw.mak
instead of writing a colossal line like "mingw32-make -f D:ProgrammingIVANivan-0.50ivanmgw.mak" and you don't have to modify the makefile each time you change IVAN's directory (for instance, you probably want to have a clean copy in addition to the directory with your own modifications; this way you need only one makefile for them). |
|
| Back to top |
|
 |
TheFallenOne222 gibberling
Joined: 03 Apr 2005 Posts: 166
|
Posted: Mon Apr 11, 2005 10:39 pm Post subject: |
|
|
That's another way it could be done. I'll add that to the guide. |
|
| Back to top |
|
 |
Atomic archangel

Joined: 12 Jan 2005 Posts: 1442 Location: In the fire
|
Posted: Tue Apr 12, 2005 10:24 pm Post subject: |
|
|
This is really starting to piss me off. Every time I compile I get fatal link error -- cannot find SDL.lib.
I have the dev libraries. I have every file I need, have done everything you suggested (aside from using MinGW -- kinda can't install programs on school computers...). Bloody hell. _________________ "Also, I'm the only person I know capable of a pelvic pary and riposte." -- Squashmonster
I moderate in red. |
|
| Back to top |
|
 |
TheFallenOne222 gibberling
Joined: 03 Apr 2005 Posts: 166
|
Posted: Tue Apr 12, 2005 11:19 pm Post subject: |
|
|
| Atomic wrote: |
This is really starting to piss me off. Every time I compile I get fatal link error -- cannot find SDL.lib.
I have the dev libraries. I have every file I need, have done everything you suggested (aside from using MinGW -- kinda can't install programs on school computers...). Bloody hell. |
Well, the tutorial is kind of intended for using MinGW, so trying it with different compilers won't help much. :P
And if you're using Visual Studio 6 or .NET, I don't think it is possible to get it to properly compile with the current source. However, try finding "SDL.lib" in your SDL install directory and copying the file to your IVAN source directory. Might help.
And if you can install the development libraries and such, are you SURE that it's not possible for you to install MinGW? |
|
| Back to top |
|
 |
Atomic archangel

Joined: 12 Jan 2005 Posts: 1442 Location: In the fire
|
Posted: Tue Apr 12, 2005 11:58 pm Post subject: |
|
|
The Dev libraries were easy -- download the file, open, copy paste. Installing is something else entirely.
Anyway I think I got the problem solved, just before class ended -- just started moving the .lib files into the main source folder. I'll continue on Thursday and see if it works.
And yeah, I'm using .NET. These link errors are the last "errors", though I'm still getting all kinds of lovely warnings about object type conversions (long to int to double, etc) _________________ "Also, I'm the only person I know capable of a pelvic pary and riposte." -- Squashmonster
I moderate in red. |
|
| Back to top |
|
 |
TheFallenOne222 gibberling
Joined: 03 Apr 2005 Posts: 166
|
Posted: Wed Apr 13, 2005 12:02 am Post subject: |
|
|
| Atomic wrote: |
| And yeah, I'm using .NET. These link errors are the last "errors", though I'm still getting all kinds of lovely warnings about object type conversions (long to int to double, etc) |
Don't be so sure. I'm 95% sure you'll get a bunch more link errors as soon as you get the lib files registering correctly. |
|
| Back to top |
|
 |
Atomic archangel

Joined: 12 Jan 2005 Posts: 1442 Location: In the fire
|
Posted: Thu Apr 14, 2005 8:33 pm Post subject: |
|
|
Success!
I've managed to compile under MVC.NET. Here's the steps I went through (that I can remember):
1. Get the source code. Put it someplace fairly simple. We'll say you put it in C:ivansource.
2. Download the SDL Dev Libraries, and put them in a folder with the source code. (for example, C:ivansourceSDL)
3. Attempt to build the code; you'll get lots of errors and warnings. This is just to help you jump from file to file and change what you need. Anywhere it says that it cannot open include file SDL.h, put in the full pathname to the file (which should be under C:ivansourceSDLincludeSDL.h, assuming you put everything where I suggested). You'll probably need to compile a few times to get all of them.
4. Now you'll have more compile errors, overloaded math functions. For each of these, put the entire equation that is being modified, in a double(...) function (for example, sqrt(overworld-->cursor) becomes sqrt(double(overworld-->cursor)). That should clear those up.
5. One more step: copy all the files in C:ivansourceSDLlib to C:ivansource. You should now be able to successfully compile, creating an IVAN.exe file in your source folder.
You might still be getting a few billion errors; these wont stop the program from compiling or executing. I'm not sure what effect they'll have on the actual program itself. Hopefully it won't break anything... _________________ "Also, I'm the only person I know capable of a pelvic pary and riposte." -- Squashmonster
I moderate in red. |
|
| Back to top |
|
 |
TheFallenOne222 gibberling
Joined: 03 Apr 2005 Posts: 166
|
Posted: Thu Apr 14, 2005 9:41 pm Post subject: |
|
|
| There's a few easier ways to do what you mentioned. I'll put together something tomorrow, as right now I'm studying for exams. |
|
| Back to top |
|
 |
Planplan mutant ass

Joined: 19 Feb 2005 Posts: 78 Location: Physically in France, mind in Dreamland
|
Posted: Thu Apr 21, 2005 8:35 pm Post subject: |
|
|
I have tested the MinGW method, by registering the bin directory in my path, and it work except small change I done for compiling.
When I try to compile, all instances to "include SDL.h" are wrong. I made chang to the concerned files by puting "include SDL/SDL.h" and it work. Maibe I have to register SDL for MinGW somewhere. Or kill the SDL directory to put all files one level up in the class directory.
But it work, it's the more important ;)
Thanks |
|
| Back to top |
|
 |
TheFallenOne222 gibberling
Joined: 03 Apr 2005 Posts: 166
|
Posted: Thu Apr 21, 2005 8:37 pm Post subject: |
|
|
| Planplan wrote: |
I have tested the MinGW method, by registering the bin directory in my path, and it work except small change I done for compiling.
When I try to compile, all instances to "include SDL.h" are wrong. I made chang to the concerned files by puting "include SDL/SDL.h" and it work. Maibe I have to register SDL for MinGW somewhere. Or kill the SDL directory to put all files one level up in the class directory.
But it work, it's the more important ;)
Thanks |
Which one of the two methods mentioned in the tutorial did you follow?
And I STILL have to put up that second tutorial. Oopsies. |
|
| Back to top |
|
 |
Planplan mutant ass

Joined: 19 Feb 2005 Posts: 78 Location: Physically in France, mind in Dreamland
|
Posted: Sun Apr 24, 2005 5:22 pm Post subject: |
|
|
| TheFallenOne222 wrote: |
| Planplan wrote: |
I have tested the MinGW method, by registering the bin directory in my path, and it work except small change I done for compiling.
When I try to compile, all instances to "include SDL.h" are wrong. I made chang to the concerned files by puting "include SDL/SDL.h" and it work. Maibe I have to register SDL for MinGW somewhere. Or kill the SDL directory to put all files one level up in the class directory.
But it work, it's the more important ;)
Thanks |
Which one of the two methods mentioned in the tutorial did you follow?
And I STILL have to put up that second tutorial. Oopsies. |
I say it ;)
I register the bin directory in the PATH Windows environnement variable But I think the change is needed for the two methods... |
|
| Back to top |
|
 |
Hippy mutant ass

Joined: 20 May 2005 Posts: 108 Location: Under A Rainbow
|
Posted: Fri May 27, 2005 1:47 am Post subject: |
|
|
Ok you lost me at the start. _________________ Come to the dark side, we have cookies! |
|
| Back to top |
|
 |
Atomic archangel

Joined: 12 Jan 2005 Posts: 1442 Location: In the fire
|
Posted: Fri May 27, 2005 6:53 am Post subject: |
|
|
Hippy, you really should even be in this section of the boards. The stuff here requires skill and intelligence, two things you don't appear to have.
Just because there happens to be a thread around doesn't mean you should read and reply to it. Especially if it's in a section of the forum for something you don't know anything about. We're not going to teach you how to program in C++. Come back in, oh, say 5 years, after you've taken at least one class in C++ programming, and have survived a couple years of high school. Actually, give it seven or eight years. That way you'll have some semblance of maturity to boot. _________________ "Also, I'm the only person I know capable of a pelvic pary and riposte." -- Squashmonster
I moderate in red. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2002 phpBB Group
|