main.c:
#include <stdio.h>
#include "proto.h"
int main(void)
{
return(0);
} // end main
support.c:
#include "proto.h"
\\ only function defintions
proto.h:
#ifndef proto
#define proto
double PI = 3.14159;
int LOOP_LIMIT = 90;
#endif
makefile:
main: main.o support.o
gcc -lm -o main main.o support.o
main.o: main.c proto.h
gcc -c main.c
support.o: support.c proto.h
gcc -c support.c
Whenever I run the makefile with the files defined as above, I always get a multiple definition error, despite having a conditional compilation.
I am not sure what is happening here and how to resolve the issue.
Error message is:
multiple definition of `PI'
multiple definition of `LOOP_LIMIT'