Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6797579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:37:33+00:00 2026-05-26T18:37:33+00:00

I am developing a small client / server application in C. At the moment

  • 0

I am developing a small client / server application in C. At the moment I was calling gcc by hand and using my own make files. I had two main() functions, one in server.c and other in client.c.

I imported all the files I had in my project’s folder into Eclipse, but when trying to compile it warned me that I had multiple definitions of main. I understand that a given executable should have a single main() function, but in this case I’d like to have 2, so I can run the server and the client, being that they share almost all the other .c files.

How to solve this? The only idea that comes to mind is to separate this in 2 (maybe 3?) projects? I’ll want to run both the server and the client concurrently and I’d like to do so (if possible) through Eclipse itself.

Thanks

Edit:

makefile:

table-client: client-lib.o
    gcc -o tabela-client table_client.c table.c base64.c list.c client-lib.o

table-server:
    gcc -o tabela-server table_server.c message.c base64.c entry.c data.c table_skel.c table.c list.c

client-lib.o:
    gcc -c remote_table.c network_client.c message.c data.c entry.c
    ld -r data.o entry.o message.o network_client.o remote_table.o -o client-lib.o

clean:
    rm -f tabela-server
    rm -f tabela-client
    rm -f *.o
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T18:37:34+00:00Added an answer on May 26, 2026 at 6:37 pm

    Yes, you better to split your project. And may be it’s better to make 3 different projects: server, client, shared library for common functions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing a small application which lists the contents from files of a
i am developing a small TCP Client/Server lib. i am facing this problem when
I am developping a 1 to many server-client application, which is a small project.
I am developing an application for Android with a small database. My client wants
We are looking at developing a small, simple, Access system for a client using
I'm developing a small utility application that needs to detect whether another one has
I'm developing a small tray-icon application for Windows and I need to display non-intrusive
I am developing a small business application which uses Sqlserver 2005 database. Platform: .Net
I am developing a small intranet based web application. I have YSlow installed and
I am currently developing an application for some researchers in my university.It's a small

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.