Pages

Monday, October 24, 2011

New Downloads / Windows Binaries

Hello!

New downloads!

<One year ago I started this project with many objectives, one of them was to make it multi-platform so yesterday I decided to compile my projects under Windows, or at least try to do it...>

<And here it comes the ingredients for my Windows recipe:
  1. A virtual machine emulator (a.k.a. Virtualbox ), Somebody will prefer a dual-boot configuration or just Windows, well, it's up to you...
  2. A Windows installation disk, you have one, right? (Important: First, clean the dust)
  3. Code::Blocks 11.05 compiler + minGW (Install, Next > Next > Next > Next > Finish.... Windows is SO user-friendly...)
  4. An assorted mix of libSDL libraries (SDL, SDL_image,SDL_ttf,SDL_net): Download, extract, and then mix them so you put all \include and all \lib files together, and of course the DLLs too.
  5. Download the sources too..
  6. If you want to compile them you will have to set up the compiler so it uses the sdl\include and sdl\lib paths, other way, it will simple refuse to work.
Another important thing is that you have to change all the includes:

#include "SDL/SDL.h"
#include "SDL/SDL_image.h"
#include "SDL/SDL_ttf.h"
#include "SDL/SDL_net.h"
#include "SDL/SDL_thread.h"  

In all the source files with:


#include "SDL.h"
#include "SDL_image.h"
#include "SDL_ttf.h"
#include "SDL_net.h"
#include "SDL_thread.h"  

(paths are a little bit different under Windows..)

<And well, that's it! after doing that I got the life game and the three rpg sub-projects working >

<I wanted to include the chat server / client project too, hey ! I really wanted to do, but I found an unexpected and silly problem, the chat server uses the std input / output for everything, I cout << what the clients "say" and get cin >> the clients input, it works fine under Linux, but under Windows, it redirects the output and errors too to the files "stdout.txt/stderr.txt", it is the normal behavior, if you are making a graphical project, you don't have the console, right? but what if you need it?>

<I have been goggling for solution and finally I found something that should work: > 


SDL_Init(SDL_INIT_VIDEO);    
if (ctt)    
{        
freopen("CON", "w", stdout);        
freopen("con", "w", stderr);        
fclose( ctt );     
}

<That was supposed to set the output again to console, I added the code, and when I executed the project under code::blocks, It magically worked again, so I happily rebuild the project...>

<And then I executed the resulting .exe, it opened a console window... (have I said it was black? completely black?) :(, that's when I decided I wont compile it for Windows ( at the moment), if anybody had found that problem and feels eager to help, I will really appreciate it...>

<In the next post, the chat server /client...>


See you
JB

No comments: