Page 4 of 4

Re: How much c++

Posted: Thu May 07, 2009 5:27 pm
by herby490
You got it?

Re: How much c++

Posted: Thu May 07, 2009 5:40 pm
by jtst1
nope.

Re: How much c++

Posted: Thu May 07, 2009 5:45 pm
by herby490
Dang same error.

Re: How much c++

Posted: Thu May 07, 2009 5:51 pm
by jtst1
indeed: Linking console executable: bin\Debug\blaaah.exe
mingw32-g++.exe: and: No such file or directory
mingw32-g++.exe: lmingw32: No such file or directory
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings

Re: How much c++

Posted: Thu May 07, 2009 5:55 pm
by herby490
You have it linked as -lmingw32 not lmingw32 (without the dash). I doubt it but its worth a shot.

Re: How much c++

Posted: Thu May 07, 2009 6:47 pm
by jtst1
didnt work :(

Re: How much c++

Posted: Thu May 07, 2009 6:51 pm
by jtst1
O SHIT GOT IT!

Re: How much c++

Posted: Thu May 07, 2009 7:07 pm
by herby490
Ok I'm going to run through the process step by step tell me if you forgot to do something.
Step 1: Download and extract SDL from the website make sure that you get the one for mingw (the one that ends in .tar.gz). (I advise putting it in your documents.

Step 2: Open Code::Blocks and click settings, compiler and debugger and under search directories click add and add the address to your recently extracted SDL include files. (Note make sure that you are under the compiler settings not the linker or resource compiler.

Step 3: Next click the linker tab and add the directory for the lib file.

Step 4: Next go over to the linker tab that is located next to search directories and copy and paste this in the other linker options box: -lmingw32 -lSDLmain -lSDL

Step 4: Close that window and go to the lib folder. In it you should find three lib files and a dll. Copy the dll and paste it in the project folder for your project.

Step 5: If you don't want the command prompt to appear go back to Code::Blocks and click project, properties, and under the tab build projects you should see a box that says console application or something like that. Click it and change it to gui application.

Step 6: Try the following code if it works a window will appear and wait for you to x out of it:

Code: Select all

#include "SDL/SDL.h"

SDL_Surface *screen = NULL;
SDL_Event event;

int main(int argc,char *argv[])
{
	if(SDL_Init(SDL_INIT_VIDEO) == -1)
		return 1;

	screen = SDL_SetVideoMode(640,480,32,SDL_SWSURFACE);
	if(screen == NULL)
		return 1;

	bool quit = false;

	while(!quit)
	{
		while(SDL_PollEvent(&event))
		{
			if(event.type == SDL_QUIT)
				quit = true;

		}

	}
	SDL_Quit();

	return 0;
}
Hope this helps if not tell me.


EDIT: Beat me to it. What was wrong?

Re: How much c++

Posted: Thu May 07, 2009 7:56 pm
by jtst1
Aparantely linker order was the problem. Gosh all that because of the order.

Re: How much c++

Posted: Thu May 07, 2009 8:18 pm
by herby490
Well if you need any more help with SDL you know where to post.

Re: How much c++

Posted: Thu May 07, 2009 10:07 pm
by jtst1
Alright, thanks :mrgreen: . I'm sure I'll need help eventually.

Re: How much c++

Posted: Fri May 08, 2009 8:46 am
by programmerinprogress
herby490 wrote:Well if you need any more help with SDL you know where to post.
Also the SDL DocWiki is an invaluable source of information http://www.libsdl.org/cgi/docwiki.cgi

If you don't quite know/forget how to implement something, or you forget which arguments to pass in a function, that's the place to go! I always find myself checking the syntax of functions like SDL_FillRect and SDL_MapRGB (well MUCH less freqently now, but you get what I mean)

If it's more of a design issue or you want to bounce some ideas off someone, I think we'd all be happy to oblige ;)

Re: How much c++

Posted: Fri May 08, 2009 10:18 am
by jtst1
programmerinprogress wrote:
herby490 wrote:Well if you need any more help with SDL you know where to post.
Also the SDL DocWiki is an invaluable source of information http://www.libsdl.org/cgi/docwiki.cgi

If you don't quite know/forget how to implement something, or you forget which arguments to pass in a function, that's the place to go! I always find myself checking the syntax of functions like SDL_FillRect and SDL_MapRGB (well MUCH less freqently now, but you get what I mean)

If it's more of a design issue or you want to bounce some ideas off someone, I think we'd all be happy to oblige ;)

Thanks for the site, i'll check it out when i get home. I'll post back when I have something substantial. Might be a while lol.