How much c++

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

herby490
Chaos Rift Regular
Chaos Rift Regular
Posts: 122
Joined: Thu Feb 12, 2009 5:59 pm

Re: How much c++

Post by herby490 »

You got it?
User avatar
jtst1
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 80
Joined: Tue Sep 30, 2008 4:32 pm
Location: Atlanta Georgia

Re: How much c++

Post by jtst1 »

nope.
When One learns to Love, One must bear the risk of Hatred.
herby490
Chaos Rift Regular
Chaos Rift Regular
Posts: 122
Joined: Thu Feb 12, 2009 5:59 pm

Re: How much c++

Post by herby490 »

Dang same error.
User avatar
jtst1
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 80
Joined: Tue Sep 30, 2008 4:32 pm
Location: Atlanta Georgia

Re: How much c++

Post 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
When One learns to Love, One must bear the risk of Hatred.
herby490
Chaos Rift Regular
Chaos Rift Regular
Posts: 122
Joined: Thu Feb 12, 2009 5:59 pm

Re: How much c++

Post by herby490 »

You have it linked as -lmingw32 not lmingw32 (without the dash). I doubt it but its worth a shot.
User avatar
jtst1
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 80
Joined: Tue Sep 30, 2008 4:32 pm
Location: Atlanta Georgia

Re: How much c++

Post by jtst1 »

didnt work :(
When One learns to Love, One must bear the risk of Hatred.
User avatar
jtst1
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 80
Joined: Tue Sep 30, 2008 4:32 pm
Location: Atlanta Georgia

Re: How much c++

Post by jtst1 »

O SHIT GOT IT!
When One learns to Love, One must bear the risk of Hatred.
herby490
Chaos Rift Regular
Chaos Rift Regular
Posts: 122
Joined: Thu Feb 12, 2009 5:59 pm

Re: How much c++

Post 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?
User avatar
jtst1
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 80
Joined: Tue Sep 30, 2008 4:32 pm
Location: Atlanta Georgia

Re: How much c++

Post by jtst1 »

Aparantely linker order was the problem. Gosh all that because of the order.
When One learns to Love, One must bear the risk of Hatred.
herby490
Chaos Rift Regular
Chaos Rift Regular
Posts: 122
Joined: Thu Feb 12, 2009 5:59 pm

Re: How much c++

Post by herby490 »

Well if you need any more help with SDL you know where to post.
User avatar
jtst1
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 80
Joined: Tue Sep 30, 2008 4:32 pm
Location: Atlanta Georgia

Re: How much c++

Post by jtst1 »

Alright, thanks :mrgreen: . I'm sure I'll need help eventually.
When One learns to Love, One must bear the risk of Hatred.
User avatar
programmerinprogress
Chaos Rift Devotee
Chaos Rift Devotee
Posts: 632
Joined: Wed Oct 29, 2008 7:31 am
Current Project: some crazy stuff, i'll tell soon :-)
Favorite Gaming Platforms: PC
Programming Language of Choice: C++!
Location: The UK
Contact:

Re: How much c++

Post 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 ;)
---------------------------------------------------------------------------------------
I think I can program pretty well, it's my compiler that needs convincing!
---------------------------------------------------------------------------------------
And now a joke to lighten to mood :D

I wander what programming language anakin skywalker used to program C3-PO's AI back on tatooine? my guess is Jawa :P
User avatar
jtst1
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 80
Joined: Tue Sep 30, 2008 4:32 pm
Location: Atlanta Georgia

Re: How much c++

Post 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.
When One learns to Love, One must bear the risk of Hatred.
Post Reply