Originally Posted by
IndioDoido
"You're running into these problems because you have code in header files. You will continue you have problems as long as you continue to do so."
What do you mean by having code in the header files?
In a header file, just include function prototypes (and if you REALLY, REALLY HAVE TO, global variables).
Do not actually write the function out inside the .h file. Define it in the equivalent .c file.
So for an example:
Code:
/* swap.h */
#ifndef SWAP_DEF
#define SWAP_DEF
void swap(int *, int *);
#endif
Code:
/* swap.c */
#include "swap.h"
void swap(int *a, int *b)
{
int temp = *a;
*a = *b;
*b = temp;
}