|
Mappyal.h conflicting declaration of BLKSTR and ANISTR |
Jakku Night
Member #17,868
June 2020
|
Hello, I'm looking out for this in the web but I cannot found anything about it. I compiled A project with mappyal.h and the compiler returns the next error: How it is? I didn't modify the code of the file and I followed all intructions to build mappyal.h. I'm using Codeblocks under Windows 10. : Here I put the header file NOTE: I'm starting programing in C/C++ and Allegro 4.2.2 ;RE |
Peter Hull
Member #1,136
March 2001
|
Almost certainly you have included mappyal.h twice, either directly or indirectly. See https://en.wikipedia.org/wiki/Include_guard Second issue, on line 46 I guess you have something like: char* text = "some text"; Just change char* to const char*
|
Jakku Night
Member #17,868
June 2020
|
Well. I'll try this and return after that Ok. I did it but the compiler now send me this errors: ||=== Build: Debug in RPG (compiler: GNU GCC Compiler) ===| What is this error? I don't know why. I followed the instructions to build the .o file and link it to my project (It is explained in the README.txt of Mappy) Should I rebuild it? What steps should I follow to link the mappyal under Codeblocks in Windows? Thanks for the responses :RE |
Edgar Reynaldo
Major Reynaldo
May 2007
|
It looks like you're linking more than once. Either add mappyal.c to your project, or link it once at the end. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
DanielH
Member #934
January 2001
|
Your main.cpp file includes "room.h" and "mappyal.h" room.h already includes mappyal.h You forgot to block duplication of header info #ifndef MAPPYAL_H #define MAPPYAL_H ... #endif
|
Jakku Night
Member #17,868
June 2020
|
Now I tryed to rebuild the project to clean all files wich are duplicated. As I can see, I have to upload the hole project to make the situation more understadable. I blocked the mappyal.h file but it doesn't result. Also I tryed to include into the project the mappyal.c but it gives me the same error. NOTE: I'm working under Windows 10 and Codeblocks IDE MinGW with Allegro 4.2.2 Thanks for your answers! |
DanielH
Member #934
January 2001
|
What is the error now? One issue is that your struct definitions are not the same. 1//mappyal.c
2typedef struct { /* Structure for data blocks */
3long int bgoff, fgoff; /* offsets from start of graphic blocks */
4long int fgoff2, fgoff3; /* more overlay blocks */
5unsigned long int user1, user2; /* user long data */
6unsigned short int user3, user4; /* user short data */
7unsigned char user5, user6, user7; /* user byte data */
8unsigned char tl : 1; /* bits for collision detection */
9unsigned char tr : 1;
10unsigned char bl : 1;
11unsigned char br : 1;
12unsigned char trigger : 1; /* bit to trigger an event */
13unsigned char unused1 : 1;
14unsigned char unused2 : 1;
15unsigned char unused3 : 1;
16} BLKSTR;
1//mappyal.h
2long int bgoff, fgoff; /* offsets from start of graphic blocks */
3long int fgoff2, fgoff3; /* more overlay blocks */
4typedef struct { /* Structure for data blocks */
5unsigned long int user1, user2; /* user long data */
6unsigned short int user3, user4; /* user short data */
7unsigned char user5, user6, user7; /* user byte data */
8unsigned char tl : 1; /* bits for collision detection */
9unsigned char tr : 1;
10unsigned char bl : 1;
11unsigned char br : 1;
12unsigned char trigger : 1; /* bit to trigger an event */
13unsigned char unused1 : 1;
14unsigned char unused2 : 1;
15unsigned char unused3 : 1;
16}BLKSTR;
|
Jakku Night
Member #17,868
June 2020
|
Thank you people. I solved the mistake including the mappyal.h file in room.cpp and doing the same for other libaries that were used in this way. Thanks you again. |
|