C Calender Help - Unusual error

I'm making a program that you input the month and year, and it creates a calender for that month of that year. This is my largest project yet, and I broke it up into several source files.

cal.c

#include "cal.h"
#include <stdio.h>

main() {
	int month, year;

	scanf("%d %d", &month, &year);
	
	if (yearstart(year) == 0)
		printf("error: year (%d) is lower then 1989:\n\tprogram will continue, but may give incorrect results\n\a", year);
	if (yearend(year) == 0)
		printf("error: year (%d) is larger then 2017:\n\tprogram will continue, but may give incorrect results\n\a", year);
	if (monthstart(month) == 0) {
		printf("error: month (%d) is lower then 1:\n\tthis error makes the program unusable; program will end now\n\a", month);
		return 0;
	}
	if (monthend(month) == 0) {
		printf("error: month (%d) is higher then 12:\n\tthis error makes the program unusable; program will end now\n\a", month);
		return 0;
	}

	monthprint(month);
	printf("\n");
}

cal.h

#define YEARSTART  1989
#define YEAREND    2017
#define MONTHSTART 1
#define MONTHEND   12

#define JANNUMBER 1
#define FEBNUMBER 2
#define MARNUMBER 3
#define APRNUMBER 4
#define MAYNUMBER 5
#define JUNNUMBER 6
#define JULNUMBER 7
#define AUGNUMBER 8
#define SEPNUMBER 9
#define OCTNUMBER 10
#define NOVNUMBER 11
#define DECNUMBER 12

int yearstart(int);
int yearend(int);
int monthstart(int);
int monthend(int);

void monthprint(int);

error.c

#include "cal.h"
#include <stdio.h>

int yearstart(int year) {
	return (year < YEARSTART) ? 0 : 1;
}
int yearend(int year) {
	return (year > YEAREND) ? 0 : 1;
}
int monthstart(int month) {
	return (month < MONTHSTART) ? 0 : 1;
}
int monthend(int month) {
	return (month > MONTHEND) ? 0 : 1;
}

print.c

#include "cal.c"
#include <stdio.h>

const char jan[] = "January";
const char feb[] = "Febuary";
const char mar[] = "March";
const char apr[] = "April";
const char may[] = "May";
const char jun[] = "June";
const char jul[] = "July";
const char aug[] = "August";
const char sep[] = "September";
const char oct[] = "October";
const char nov[] = "November";
const char dec[] = "December";

void monthprint(int month) {
	switch(month) {
		case JANNUMBER:
			printf("%s", jan);
			break;
		case FEBNUMBER:
			printf("%s", feb);
			break;
		case MARNUMBER:
			printf("%s", mar);
			break;
		case APRNUMBER:
			printf("%s", apr);
			break;
		case MAYNUMBER:
			printf("%s", may);
			break;
		case JUNNUMBER:
			printf("%s", jun);
			break;
		case JULNUMBER:
			printf("%s", jul);
			break;
		case AUGNUMBER:
			printf("%s", aug);
			break;
		case SEPNUMBER:
			printf("%s", sep);
			break;
		case OCTNUMBER:
			printf("%s", oct);
			break;
		case NOVNUMBER:
			printf("%s", nov);
			break;
		case DECNUMBER:
			printf("%s", dec);
			break;
		defualt:
			printf("fatal error\n\a");
			break;
	}
}

And here is my compile method:

~/c/etc/calender $ ls
cal.c  cal.h  error.c  print.c
~/c/etc/calender $ gcc -o cal cal.c cal.h error.c print.c
/tmp/ccU3dRmi.o: In function `main':print.c:(.text+0x0): multiple definition of `main'
/tmp/ccscxcaw.o:cal.c:(.text+0x0): first defined here
collect2: ld returned 1 exit status

There is no main in print.c...is there?

Check your print.c file:

#include "cal.c"
#include <stdio.h>

You have #included cal.c instead of cal.h. This is causing the multiple occurance of main. Fix that and it should compile.

FWIW - consider the C standard library for most of what you're doing.

#include <time.h>
#include <stdio.h>

char *setday1(char *month, char *year, struct tm *input)
{
	struct tm *retval=NULL;
	char tmp[80]={0x0};
	
	sprintf(tmp,"01-%s-%s", month, year);
	if(strptime(tmp,"%d-%m-%Y", input) == NULL) /* format for dd-mm-yyyy */
		return NULL;
	return month;
}

int main(int argc, char **argv)
{
	struct tm working;
	char date[80]={0x0};

	if( setday1(argv[1], argv[2], &working)!=NULL)	
		strftime(date, 80, "%A, %B %d, %Y", &working);		
	else
	{
		fprintf(stderr, "Bad date\n");
		return 1;
	}
	printf("First day of the month: %s\n", date);	
	return 0;
}

man mktime
man strptime
man strftime

No idea how I missed that. Thanks.