Wow that was quick, thaks guys for your responses. I try codeplug's solution, but it just don't work. Here is what i'm trying to do, and also necessary file's code structure to help you understand me in a better manner.
TIFFheader.h
Code:
#ifndef hfile_TIFFheader
#define hfile_TIFFheader
typedef struct s_tiff_header
{
short lsb;
long bitsPerPixel;
long imageWidth;
long imageHeight;
long stripOffset;
}tiff_header;
... // constant declarations come here
... // declarations of functions located at TIFFheader.c file
#endif
Decs.h
Code:
#include <stdlib.h>
#include <stdio.h>
#include <io.h>
#include <fcntl.h>
#include <dos.h>
#include <math.h>
#include <malloc.h>
#include <string.h>
#include <sys\types.h>
#include <sys\stat.h>
#include "TIFFheader.h"
... // unions declared here
TIFFheader.c
Code:
#include "decs.h" // relevant line
tiff_header getTiffHeader ( const char* filename )
{
tiff_header header;
char buffer[12];
FILE *image;
short notFinished,
tag,
tagValueType,
directoriesCount;
int i,
bytesRead;
... // function goes on, and others too
main.c
Code:
#include <stdio.h>
#include <stdlib.h>
#include "decs.h" //relevant include
int main(int argc, char *argv[])
{
tiff_header hdr;
char filepath[20];
printf ( "Ingrese la ruta de la imagen: \n" );
scanf ( "%s" , filepath );
printf ( "Usted ingreso %s", filepath );
hdr = getTiffHeader ( filepath );
system("PAUSE");
return 0;
}
The specific error is
multiple definition of __BYTE
multiple definition of __ASCII
multiple definition of __SHORT
multiple definition of __LONG
multiple definition of __RATIONAL
...
and so on with all constants declared below. So, it tells to me that i'm defined constant, but not functions and structures twice.
Am i applying codeplug's solution well?. I hope you can help me out on this guys.
Thanks in advance.