When I try and link together 3 object files, I get the following
problem:
gcc fusionFileIO.o fusionAlgorithm s.o main.o -o fusionTK.exe
main.o:main.c:( .rdata+0x0): multiple definition of `_BAD_IMAGE'
fusionFileIO.o: fusionFileIO.c: (.rdata+0x0): first defined here
collect2: ld returned 1 exit status
make: *** [fusionTK.exe] Error 1
The problem in question comes from the following header file, which is
included in all of the object files:
#define FILE_BUFFER_SIZ E 256
typedef struct
{
//image dimensions
int pixPerLine;
int numLines;
//image data
char *data;
} image_t;
const image_t BAD_IMAGE = {-1, -1, 0x0};
This is the only time BAD_IMAGE is defined.
Any thoughts on where Im going wrong?