I'm trying to generate two exes, client and server using a C Project in eclipse. Both have main functions since they are different exes. Both use a common confutils.c file. How do I solve the multiple definitions of main problem. I know that we cannot have two mains in a single project. My makefile looks like below.
.c.o:
gcc -g -c $?
# compile client and server
all: confclient confserver
# compile client only
confclient: confclient.o confutils.o
gcc -g -o confclient confclient.o confutils.o
# compile server program
confserver: confserver.o confutils.o
gcc -g -o confserver confserver.o confutils.o
I replaced eclipse file with this. I don't know if eclipse read it properly. I don't like to split this project into two since it is such a simple program. I am able to run these files in unix with no issues. I'm trying to find if there is an option in eclipse using which we can setup build configurations.