Jump to content
  • Advertisement
Sign in to follow this  
thugkilla

Trouble with moving the menu.

This topic is 4829 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi guys I'am having a little trouble with the main menu.I fixed all my errors when compiling and basically all I need it to do is blit 2 things to the screen for now until I add on ,but lately my compiler,Dev C++ has been getting on my nerves. #include "allegro.h" typedef struct stats { int x,y; int curframe,maxframe,width,height; int xspeed,yspeed; int xdelay,ydelay; int xcount,ycount; int framedelay; int framecount; }SPRITE; SPRITE *gui; SPRITE *player; int gameover=0; BITMAP *buffer; BITMAP *screenmode; BITMAP *choose; BITMAP *temp; //Below are the functions. BITMAP *grabframe(BITMAP *source,int width,int height,int startx,int starty,int colums,int rows); void loadsprites(void); void showall(void); void move_choose(void); //useing the functions int main(int argc,char *argv[]) { gui->x=200; gui->y=200; void loadsprites(void); while (!key[KEY_ESC]) { void showall(void); } destroy_bitmap(buffer); destroy_bitmap(screenmode); destroy_bitmap(choose); return 0; } void loadsprites(void) { allegro_init(); install_keyboard(); install_timer(); set_color_depth(32); set_gfx_mode(GFX_AUTODETECT,320,240,0,0); choose=load_bitmap("toop.bmp",NULL); screenmode=load_bitmap("mode.bmp",NULL); buffer = create_bitmap(320,240);} void showall(void) { blit(screenmode,buffer,0,0,0,0,SCREEN_W,SCREEN_H); draw_sprite(buffer,choose,gui->x,gui->y); blit(buffer,screen,0,0,0,0,SCREEN_W,SCREEN_H); } Compiler: Default compiler Building Makefile: "C:\Documents and Settings\armgame\Desktop\projects\minifighters\Makefile.win" Executing make... make.exe -f "C:\Documents and Settings\armgame\Desktop\projects\minifighters\Makefile.win" all windres.exe -i fixofmini_private.rc --input-format=rc -o fixofmini_private.res -O coff windres.exe: no resources make.exe: *** [fixofmini_private.res] Error 1 Execution terminated This is my error log.I don't know whats wrong with it I think its the compiler.

Share this post


Link to post
Share on other sites
Advertisement
The problem is not with your code, it's with your resource file (fixofmini_private.rc). The resource compiler (windres.exe) says there are no resources in your .rc file.

Share this post


Link to post
Share on other sites
Compiler: Default compiler
Building Makefile: "C:\Dev-Cpp\Makefile.win"
Executing make...
make.exe -f "C:\Dev-Cpp\Makefile.win" all
g++.exe -c main.cpp -o main.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include"

windres.exe -i MiniFighter_private.rc --input-format=rc -o MiniFighter_private.res -O coff

g++.exe main.o MiniFighter_private.res -o "MiniFighter.exe" -L"C:/Dev-Cpp/lib" -mwindows -lalleg

C:/Dev-Cpp/lib/libmingw32.a(main.o)(.text+0x106):main.c: undefined reference to `WinMain@16'
collect2: ld returned 1 exit status

make.exe: *** [MiniFighter.exe] Error 1

Execution terminated
I try and reinstalled and here is the error I get.

Share this post


Link to post
Share on other sites
That fixed that problem ,but now when I try to run it says MiniFighters.exe has encountered a problem and needs to close what now?

Share this post


Link to post
Share on other sites
That means there is a runtime problem with your code. You need to use the debugger (there is a command to debug your program within Dev-C++). This will run your program, and when the program crashes take you to the line of code that caused the crash.

Note that you need to have it produce debugging symbols when compiling. I'm not familiar with Dev-C++, but this option is probably in a menu called "Build Options" or "Compiling Options" or some such.

Cheers,
Twilight Dragon

Share this post


Link to post
Share on other sites
Debugging is an important skill for a programmer. It takes quite a lot of practise to become good at. Try a search on google or this forum for debugging tips. Good luck on fixing the error [grin]!

Share this post


Link to post
Share on other sites
Okay here is my new source code after I "debugged"Now I have some more errors
Okay something weird happened my Project was running in processes!.


#include "allegro.h"
typedef struct SPRITE
{
int x,y;
}SPRITE;
SPRITE *gui;
int gameover=0;
gui->x=100;
gui->y=200;

BITMAP *buffer;
BITMAP *screenmode;
BITMAP *choose;
BITMAP *temp;


//Below are the functions.
BITMAP *grabframe(BITMAP *source,int width,int height,int startx,int starty,int colums,int rows);
void loadsprites(void);
void showall(void);
void move_choose(void);
//useing the functions


void main(void)
{

void loadsprites(void);
while (!key[KEY_ESC])
{
void showall(void);
}
destroy_bitmap(buffer);
destroy_bitmap(screenmode);
destroy_bitmap(choose);
}
END_OF_MAIN();
void loadsprites(void)
{
allegro_init();
install_keyboard();
install_timer();
set_color_depth(32);
set_gfx_mode(GFX_AUTODETECT,320,240,0,0);
choose=load_bitmap("toop.bmp",NULL);
screenmode=load_bitmap("mode.bmp",NULL);

buffer = create_bitmap(320,240);}
void showall(void)
{
blit(screenmode,buffer,0,0,0,0,SCREEN_W,SCREEN_H);
draw_sprite(buffer,choose,gui->x,gui->y);
blit(buffer,screen,0,0,0,0,SCREEN_W,SCREEN_H);
}

Here is my error log please help
Compiler: Default compiler
Building Makefile: "C:\Dev-Cpp\Makefile.win"
Executing make...
make.exe -f "C:\Dev-Cpp\Makefile.win" all
g++.exe -c main.cpp -o main.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include"

main.cpp:8: error: expected constructor, destructor, or type conversion before '->' token
main.cpp:8: error: expected `,' or `;' before '->' token
main.cpp:9: error: expected constructor, destructor, or type conversion before '->' token

main.cpp:9: error: expected `,' or `;' before '->' token

make.exe: *** [main.o] Error 1

Execution terminated

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!