Search found 33 matches
- Wed Jun 02, 2010 1:31 pm
- Forum: Programming Discussion
- Topic: linking files
- Replies: 19
- Views: 1726
Re: linking files
I made all the variables extern (extern bool map[15]), and in a differnt folder I declared then did [bool map[15]], and the code seems to work, I have no clue why this would change things.
- Wed Jun 02, 2010 1:17 pm
- Forum: Programming Discussion
- Topic: linking files
- Replies: 19
- Views: 1726
Re: linking files
if I take it away then an error appears in the .cpp that actually uses the array. I checked and its not declared twice in the header.
- Wed Jun 02, 2010 1:07 pm
- Forum: Programming Discussion
- Topic: linking files
- Replies: 19
- Views: 1726
Re: linking files
I am getting an error "multiple definition of 'map' ", which is an array. The error seems to include everything that is declared in the same .h file, which mostly declares arrays, map would be declared as "bool map[15];".
- Mon May 31, 2010 4:49 pm
- Forum: Programming Discussion
- Topic: linking files
- Replies: 19
- Views: 1726
Re: linking files
I had this project working in codeblocks before then I added a new header and a new .cpp, and all the errors are with including them. I did have to switch the files in main to .h
- Mon May 31, 2010 4:45 pm
- Forum: Programming Discussion
- Topic: linking files
- Replies: 19
- Views: 1726
Re: linking files
in main i am including the .cpp's and in the .cpp's I am including the .h. I don't know why this works in gcc, but if I switch it so main includes .h's it doesn't work.
- Mon May 31, 2010 4:39 pm
- Forum: Programming Discussion
- Topic: linking files
- Replies: 19
- Views: 1726
Re: linking files
if I have main.cpp linking to class1.h, wouldn't I need class1.h to link to class1.cpp to work?
- Mon May 31, 2010 3:55 pm
- Forum: Programming Discussion
- Topic: linking files
- Replies: 19
- Views: 1726
Re: linking files
here is a header file, all the header files pretty much follow this same format #ifndef GLOBALS_H #define GLOBALS_H #include <SDL/SDL.h> extern SDL_Surface *buffer; extern SDL_Surface *title; extern SDL_Event event; extern bool done; extern bool turn; extern bool bkey; extern bool ckey; extern bool ...
- Mon May 31, 2010 3:47 pm
- Forum: Programming Discussion
- Topic: linking files
- Replies: 19
- Views: 1726
Re: linking files
I would, but the files are incredibly huge, and they compile under gcc, so I would assume the problem is codeblocks specific. I have the file as a GUI application, and the linker settings are -lmingw32 -lSDLmain -lSDL -lSDL_image.
- Mon May 31, 2010 3:41 pm
- Forum: Programming Discussion
- Topic: linking files
- Replies: 19
- Views: 1726
Re: linking files
I changed all the includes to .h, but the compiler is complaining about redefinitions, each .h has its own
#ifndef CLASS_H
#define CLASS_H
#endif
#ifndef CLASS_H
#define CLASS_H
#endif
- Mon May 31, 2010 3:27 pm
- Forum: Programming Discussion
- Topic: linking files
- Replies: 19
- Views: 1726
linking files
I'm using codeblocks and am having tons of linking errors, I was wondering if I am linking files incorrectly main #include "class.cpp" #include "class2.cpp" class.cpp #include <SDL/SDL.h> #include <SDL/SDL_image.h> #include "class2.cpp" #include "class.h" clas...
- Sat May 29, 2010 4:39 pm
- Forum: Game Development
- Topic: My Chess Program
- Replies: 30
- Views: 5724
Re: my chess Program
how is the project coming along?
- Fri May 28, 2010 6:38 pm
- Forum: Programming Discussion
- Topic: curved line in SDL
- Replies: 3
- Views: 609
curved line in SDL
is it possible to make a curved line is SDL?
- Mon May 24, 2010 11:54 am
- Forum: Game Development
- Topic: My Chess Program
- Replies: 30
- Views: 5724
Re: my chess Program
I hope you add an engine, or some pgn support, maybe an option to take back moves, all in all I like it. I tried it on vista and seems to work fine.
- Tue May 18, 2010 8:47 pm
- Forum: Programming Discussion
- Topic: [SOLVED] SDL loading images problem
- Replies: 9
- Views: 752
Re: [SOLVED] SDL loading images problem
I understand that an array of 10 is numbered 0 - 9, but what I was attempting to do was something like this, looking at the code I was setting the array 0 - 6 tile[6]; for (int i=1; int i<7; i++) { tile[i-1].x = (i)*PIECE_SIZE; tile[i-1].y = 0; tile[i-1].w = PIECE_SIZE; tile[i-1].h = PIECE_SIZE; } I...
- Tue May 18, 2010 5:13 pm
- Forum: Current Events and Science/Technology
- Topic: Voyager 2 stops making sense
- Replies: 5
- Views: 1727
Re: Voyager 2 stops making sense
McKay and co-workers found no evidence of bacteria in other meteorites from the same area where ALH 84001 was discovered, so they conclude that the bacteria-shaped structures in ALH 84001 are not Earth bacteria. It remains possible that the bacteria shapes are Earth bacteria. Although McKay and col...