[Tutorial] Compiling Wolf4SDL with Code::Blocks
Select messages from
# through # FAQ
[/[Print]\]
Goto page 1, 2, 3, 4  Next  :| |:
DieHard Wolfers -> SDL Code Crackers

#1: [Tutorial] Compiling Wolf4SDL with Code::Blocks Author: dcbasic PostPosted: Tue Jul 01, 2008 3:08 pm
    —
If you're having trouble figure out what tools are needed to compile Wolf4SDL then read this. I'm going to show you how to setup Code::Blocks, an excellent open-source IDE and SDL. These instructions assume you know how to navigate through folders and extract compressed archives. It also assumes Code::Blocks is installed at C:\Program Files\CodeBlocks.

WARNING! These instructions are for Windows only!

What you will need

NOTE! Make sure you install the MinGW compiler when installing Code::Blocks!

NOTE: I have written a batch file to automatically setup SDL and SDL Mixer for Code::Blocks. If you want to use it instead to setting them up yourself you can find the download over here. Once SDL is installed you can go on to the third section (Configuring SDL & SDL Mixer with the Wolf4SDL Code::Blocks project file). If you have downloaded my batch file, it's unnecessary to download SDL or SDL_mixer since it includes SDL and SDL's DLL files...

Setting up SDL
  1. Extract SDL to it's own folder.
  2. Open the include folder that is inside the extracted SDL folder.
  3. Open C:\Program Files\CodeBlocks\MinGW\include.
  4. Copy\Move the SDL folder from step 2 to the Code::Blocks include folder in step 3.
  5. Open the lib folder that is inside the extracted SDL folder.
  6. Open C:\Program Files\CodeBlocks\MinGW\lib.
  7. Copy\Move the three files from step 5 to the Code::Blocks lib folder in step 6.

Setting up SDL Mixer
  1. Extract SDL Mixer to it's own folder.
  2. Open the include folder that is inside the extracted SDL Mixer folder.
  3. Open C:\Program Files\CodeBlocks\MinGW\include\SDL.
  4. Copy\Move the SDL_mixer.h file from step 2 to the Code::Blocks include\SDL folder in step 3.
  5. Open the lib folder that is inside the extracted SDL Mixer folder.
  6. Open C:\Program Files\CodeBlocks\MinGW\lib.
  7. Copy\Move the SDL_mixer.lib file from step 5 to the Code::Blocks lib folder in step 6.

Configuring SDL & SDL Mixer with the Wolf4SDL Code::Blocks project file
  1. Extract the Wolf4SDL source code to it's own folder.
  2. Open Wolf4SDL.cbp inside Code::Blocks.
  3. Goto Project > Build options....
  4. Select Wolf4SDL (the parent node of the tree list).
  5. Click the main tab Search directories and edit the current path to SDL in the Compiler and Linker tabs respectively to C:\Program Files\CodeBlocks\MinGW\include\SDL and C:\Program Files\CodeBlocks\MinGW\lib.

Compiling Wolf4SDL
  1. Make sure Wolf4SDL is the active project if you have another project opened. You can activate your Wolf4SDL project by right-clicking Wolf4SDL in the project management list and clicking Activate project.
  2. Goto Build > Build.

Running Wolf4SDL
  1. Open the bin folder that is inside the extracted SDL folder.
  2. Open the folder you extracted Wolf4SDL's source code to.
  3. Copy\Move the SDL.dll file from step 1 to the folder in step 2.
  4. Open the lib folder that is inside the extracted SDL Mixer folder.
  5. Copy\Move the SDL_mixer.dll file from step 4 to the folder in step 2.
  6. Run Wolf4SDL.exe.


Last edited by dcbasic on Sun Oct 06, 2013 4:18 pm; edited 3 times in total

#2: Re: [Tutorial] Compiling Wolf4SDL with Code::Blocks Author: TheTalentedMrLeo PostPosted: Wed Jul 02, 2008 8:10 pm
    —
Moving to Code Tutorials...

#3: Re: [Tutorial] Compiling Wolf4SDL with Code::Blocks Author: RipperLocation: Germany PostPosted: Sun Jul 13, 2008 4:48 am
    —
Nice tutorial. Good work!

#4: Re: [Tutorial] Compiling Wolf4SDL with Code::Blocks Author: MetalorLocation: California PostPosted: Fri Dec 05, 2008 2:11 pm
    —
I tried setting the compiler up, as it says in the tutorial, but whenever I try to build anything, it states: "#error You should copy include/SDL_config.h.default to include/SDL_config.h"

How do I fix this problem? Since I can't seem to find any way to fix it on my own. (I'm sorry to say that I'm not C++ savvy at the moment, this usually happens whenever I have to switch to a new compiler)

#5: Re: [Tutorial] Compiling Wolf4SDL with Code::Blocks Author: StoneFrogLocation: New Jersey PostPosted: Fri Dec 05, 2008 3:20 pm
    —
Did you add your SDL files via the batch file written by dcbasic, or did you download the zips and install them yourself? I got some similar error with the batch (it's probably obsolete with the current Code::Blocks setup somehow), and when I started over and installed the files myself all was well.

#6: Re: [Tutorial] Compiling Wolf4SDL with Code::Blocks Author: MetalorLocation: California PostPosted: Fri Dec 05, 2008 4:15 pm
    —
I tried the batch, but my computer won't allow access to it, so i did it myself (using the files found with the batch, I manually moved them following the steps listed above)

It might be a missing file, but I'm not fully sure.

#7: Re: [Tutorial] Compiling Wolf4SDL with Code::Blocks Author: StoneFrogLocation: New Jersey PostPosted: Fri Dec 05, 2008 4:33 pm
    —
It's not the batch file's specific instructions, but the files that are outdated, I think.

I'm referring to downloading these:

dcbasic wrote:

[*]SDL Devel Win32\MinGW - http://www.libsdl.org/download-1.2.php
[*]SDL Mixer Devel Win32 - http://www.libsdl.org/projects/SDL_mixer/


...and trying to install them per his instructions. Good luck.

#8: Re: [Tutorial] Compiling Wolf4SDL with Code::Blocks Author: MetalorLocation: California PostPosted: Fri Dec 05, 2008 5:16 pm
    —
I did download those, but I don't think that I've tried them, let me check.

#9: Re: [Tutorial] Compiling Wolf4SDL with Code::Blocks Author: MetalorLocation: California PostPosted: Fri Dec 05, 2008 5:22 pm
    —
Okay, nope, still not workin'.

#10: Re: [Tutorial] Compiling Wolf4SDL with Code::Blocks Author: AlumiuNLocation: Christchurch, New Zealand PostPosted: Fri Dec 05, 2008 8:45 pm
    —
Try going into the include folder in the Code::Blocks directory and copying sdl_config.h.default to the same directory as sdl_config.h . Smile

#11: Re: [Tutorial] Compiling Wolf4SDL with Code::Blocks Author: MetalorLocation: California PostPosted: Fri Dec 05, 2008 9:45 pm
    —
That would seem to be the solution at first, but I don't have a file like that in any of the directories. Perhaps the file I downloaded simply did not contain the file, I am unsure.

#12: Re: [Tutorial] Compiling Wolf4SDL with Code::Blocks Author: StoneFrogLocation: New Jersey PostPosted: Sat Dec 06, 2008 7:26 am
    —
It should be within your \include\SDL\ directory (as if you didn't already know that thanks to the error message).

I use Dev-C++ so I'm not sure, but I think Dev-C++ included some of the SDL files. Are you using Code::Blocks?

#13: Re: [Tutorial] Compiling Wolf4SDL with Code::Blocks Author: MetalorLocation: California PostPosted: Sat Dec 06, 2008 7:33 am
    —
Code Blocks, indeed. I looked within the file, and I even tried making a psuedo version from the same file, trying to somewhat appease it, and that did not fix anything. I tried Dev-C++, but I get lots of error warnings with that one, saying that instead, the code I'm using is outrageously flawed. (BTW I'm using the activision version of the code if that somehow makes a difference)

#14: Re: [Tutorial] Compiling Wolf4SDL with Code::Blocks Author: StoneFrogLocation: New Jersey PostPosted: Sat Dec 06, 2008 9:51 am
    —
I could've sworn Wolf4SDL only has one source code, but you can modify #indefs to change the versions and whatnot. Mine, at least, is initially coded for the activision version.

Are you sure you're setting up your files properly? I had no issues with Dev-C++ compiling mine. Make sure you have the mingw32 and developer versions of all the SDL files.

#15: Re: [Tutorial] Compiling Wolf4SDL with Code::Blocks Author: MetalorLocation: California PostPosted: Sat Dec 06, 2008 10:36 am
    —
Sorry, got a bit confused, I'm using the regular source code (there is no second type, I just have two types of the Wolf4SDL exe's that I downloaded)

I guess I'll try fixing it, now I just need to find the mingw32 files I guess, and see if I can't get Dev-C++ to work properly.

#16: Re: [Tutorial] Compiling Wolf4SDL with Code::Blocks Author: MetalorLocation: California PostPosted: Sat Dec 06, 2008 10:58 am
    —
Okay, I tried it and nope, couldn't get it to work. When I try to use Dev-c++ it usually says the first thing that somethign is wrong with the wl_text.cpp file, and won't go past there. Is there a tutorial for setting it up or something that I could look at? Cause, I'm growing weary of this. (this happened with my first compiler, the Boarland C+ compiler, back when I first started coding)

#17: Re: [Tutorial] Compiling Wolf4SDL with Code::Blocks Author: MetalorLocation: California PostPosted: Sat Dec 06, 2008 11:57 am
    —
Okay, I tried another tactic, I completely deleted all of the Dev-C++ and Code::Blocks files and then reinstalled what I was supposed to, and followed all of the instructions to the letter, and now, it just got me back to where I was in the first place. "c:\program files\codeblocks\mingw\include\sdl\SDL_config.h|34|fatal error C1189: #error : You should copy include/SDL_config.h.default to include/SDL_config.h|"

I did notice that there was a section that said, "Make sure that this isn't included by Visual C++" But I'm not quite sure how to do that either.

#18: Re: [Tutorial] Compiling Wolf4SDL with Code::Blocks Author: MetalorLocation: California PostPosted: Sun Dec 07, 2008 12:07 am
    —
Well, I've tried three different compilers now, I've tried to find the above mentioned missinng file, I've tried every (illegible) thing I could think of, I'm tired, I want to know EXACTLY how someone else set theirs up, images, previews, anything! I'd accept them through email, just so I can get through with this (illegible) and get on to doing what I love (making Wolfenstein mods, not (illegible) around with this crap)

#19: Re: [Tutorial] Compiling Wolf4SDL with Code::Blocks Author: StoneFrogLocation: New Jersey PostPosted: Sun Dec 07, 2008 8:55 am
    —
Metalor wrote:
Sorry, got a bit confused, I'm using the regular source code (there is no second type, I just have two types of the Wolf4SDL exe's that I downloaded)


The non-SDL source code? I think that will explode with the compilers used for SDL compiling!

I don't know how you can have two types of the Wolf4SDL exe. Are you talking about the "Apogee Shareware" "Apogee 1.4" "Activision" "Spear Demo" and "Spear of Destiny" downloads? Those are irrelevant and for PLAYING said games in SDL form.

You want this.

Sorry if you do have that and I'm not reading you correctly, I'm not a big C++ aficionado myself so I'm giving you all the generic tech support-esque answers. Embarassed

#20: Re: [Tutorial] Compiling Wolf4SDL with Code::Blocks Author: MetalorLocation: California PostPosted: Sun Dec 07, 2008 10:00 am
    —
I eamnt that I have the regular "Wolf4SDL" source code, and I have the binary exe's for the Activision and Apogee Wolf4SDL. Real quick question, does your C++ configuration have the SDL_config.h.default file, or is there a special configuration to your compiler? I just want to be sure, because the smallest change can mean a world of difference when it comes to this sort of thing.

#21: Re: [Tutorial] Compiling Wolf4SDL with Code::Blocks Author: StoneFrogLocation: New Jersey PostPosted: Sun Dec 07, 2008 10:40 am
    —
I do not seem to have it. Within my include\SDL\ directory, I have the following:



I have an SDL_config.h but no default. That's probably just some internal name used by your compiler's setup. I did not have to make any modifications to my compiler's configuration upon installing it and adding the various files listed in the OP. I believe that the OP's Configuring SDL & SDL Mixer with the Wolf4SDL Code::Blocks project file is, well, obviously, for Code::Blocks as I did not have to change a thing with Dev-C++.

#22: Re: [Tutorial] Compiling Wolf4SDL with Code::Blocks Author: dcbasic PostPosted: Sun Dec 07, 2008 11:08 am
    —
My batch file is missing an important line if MinGW isn't installed in CodeBlocks' directory.

Copy this line at line 18 of the batch file:
::: CODE :::
mkdir /Y "C:\Program Files\CodeBlocks svn\MinGW\lib


My include\SDL folder does NOT have SDL_config.h.default; it compiles without a hitch!

EDIT:
Quote:
I believe that the OP's Configuring SDL & SDL Mixer with the Wolf4SDL Code::Blocks project file is, well, obviously, for Code::Blocks as I did not have to change a thing with Dev-C++.

The Code::Blocks project file that comes with Wolf4SDL's source isn't setup for an specific dev environment AFAIK. I think Ripper uses the Dev-C++ project file so it should be more optimized.

#23: Re: [Tutorial] Compiling Wolf4SDL with Code::Blocks Author: MetalorLocation: California PostPosted: Sun Dec 07, 2008 11:56 am
    —
*to StoneFrog: Oddly enough, I have all of those files.

*to dcbasic: I'll see if that's what the problem is right away!

#24: Re: [Tutorial] Compiling Wolf4SDL with Code::Blocks Author: MetalorLocation: California PostPosted: Sun Dec 07, 2008 12:11 pm
    —
Okay, I tried fixing the batch, but my computer simply won't allow it to work, so I manually installed the programs into the correct folders, but nadda. It states above the line in question, that causes all of the problems that:

"#ifdef _MSC_VER
#error You should copy include/SDL_config.h.default to include/SDL_config.h
#endif"

Would the version of the file make a difference? I'm using the latest 1.6 Wolf4SDL source code, maybe something about the line "_MSC_VER" might be the problem?

Really, no matter what I try, I still end up getting that same error message.

#25: Re: [Tutorial] Compiling Wolf4SDL with Code::Blocks Author: dcbasic PostPosted: Sun Dec 07, 2008 3:34 pm
    —
Try setting the compiler to GNU GCC Compiler. Open the Wolf4SDL Code::Blocks project file and goto Project > Build options and select the parent node, "Wolf4SDL," and make sure the selected compiler says "GNU GCC Compiler."

#26: Re: [Tutorial] Compiling Wolf4SDL with Code::Blocks Author: MetalorLocation: California PostPosted: Sun Dec 07, 2008 3:44 pm
    —
Okay, the exe did somewhat compile, but it was chock full of warnings, I'll try re-extracting the source code, and then see if that fixes that little tidbit.

#27: Re: [Tutorial] Compiling Wolf4SDL with Code::Blocks Author: MetalorLocation: California PostPosted: Sun Dec 07, 2008 3:59 pm
    —
Well, aside from the 88 or so warnings, the exe compiled, and the game runs. Thank you for your tutorial and help, my problems are finally over (well this problem anyways) Thanks again, thanks thanks, a million times thanks! (however in case this may be repeated, you may want to update the tutorial to mention to leave the compiler in Code Blocks as the GNU GCC Compiler, which is what apparently was my problem, which came about because I was originally unsure if I had that particular compiler or not)

But thanks again!

#28: Re: [Tutorial] Compiling Wolf4SDL with Code::Blocks Author: dcbasic PostPosted: Sun Dec 07, 2008 5:23 pm
    —
No problem, glad it worked.

#29: Re: [Tutorial] Compiling Wolf4SDL with Code::Blocks Author: MetalorLocation: California PostPosted: Sun Dec 07, 2008 6:28 pm
    —
Me too!

#30: Re: [Tutorial] Compiling Wolf4SDL with Code::Blocks Author: totixtremeLocation: Santiago, Chile PostPosted: Sat Dec 19, 2009 7:07 pm
    —
I've got some problems:

When I build the project the "build log" says:
"Wolf4SDL - default" uses an invalid compiler. Skipping...
Nothing to be done.

I'm using GNU GCC Compiler, I don't know what to do.
----
edit: well, now i have tried the compiler in windows 7 and is working, so, i have virtualized a windows xp on my vista pc and now itīs working



DieHard Wolfers -> SDL Code Crackers


output generated using printer-friendly topic mod. All times are GMT

Goto page 1, 2, 3, 4  Next  :| |:
Page 1 of 4

Powered by phpBB © 2001, 2005 phpBB Group