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

  • SEARCH
  • Home
  • 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 8616207
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T05:33:46+00:00 2026-06-12T05:33:46+00:00

I’m a little stuck. I have almost finished this code but after trying to

  • 0

I’m a little stuck. I have almost finished this code but after trying to make it compatible for windows and linux, I came across this problem I can’t solve. I haven’t had too much experience in this area. Here are errors-

$ gcc client.c client.h clientdata.c clientdata.c -o client.exe
/tmp/ccHpxeKs.o:clientdata.c:(.text+0x0): multiple definition of `_handleSendingData'
/tmp/cclpyPee.o:clientdata.c:(.text+0x0): first defined here
/tmp/ccHpxeKs.o:clientdata.c:(.text+0xa9): multiple definition of `_handleRecievingData'
/tmp/cclpyPee.o:clientdata.c:(.text+0xa9): first defined here
/tmp/ccHpxeKs.o:clientdata.c:(.text+0xabb): multiple definition of `_replaceNewLineChar'
/tmp/cclpyPee.o:clientdata.c:(.text+0xabb): first defined here
/tmp/ccHpxeKs.o:clientdata.c:(.text+0xb1c): multiple definition of `_getMyTime'

………..

I have 4 files-
client.c-

#include "client.h"
#ifdef _WIN32
#include "clientdata.c"
#endif //win32

client.h-

#ifndef CLIENT
#define CLIENT

#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include <signal.h>
#include <time.h>

#define MAXSIZE 2048
#define MILLION  1000000.0

#ifdef _WIN32

#include <winsock.h>
#pragma comment(lib, "wsock32.lib")


#else

#include <sys/socket.h>
#include <netdb.h>
#include <dirent.h>
#include <unistd.h>

#endif //win32

typedef enum {false = 0, true = 1, maybe = 2} bool;

struct messageNode
{
    struct timeval  *time1;
    struct timeval  *time2;
    int idNumber;
    char string[MAXSIZE];
    char stringClientArgs[MAXSIZE];
    struct messageNode* next;
    struct messageNode* moreNext;
    char redirectArgs[MAXSIZE];

} *head, *current;


int handleSendingData(struct messageNode *Node);
int handleRecievingData(struct messageNode *Node);
void printNode(struct messageNode *Node);
int setArgs(struct messageNode *Node, int command);
int setNode(struct messageNode* Node, int id);
int getArgs(struct messageNode* Node, char **newArgs);


#endif //CLIENT

clientdata.c-

#include "client.h"
#include "clientdata.h"

clientdata.h-

#ifndef CLIENTDATA
#define CLIENTDATA

#ifdef _WIN32
#include <process.h>
#endif //win32


void replaceNewLineChar(int count, ...);
void copyArray(char* str1, char* str2);
int addId(char *string, int id);
int getId(char *string);
int getReceivedArgs(char *string, char **newArgs, int number);
int getCommand(char* string);
int addToString(char *string, char *text);
int execute(char *cmd, char **args);
int getRedirectArgs(char *string, char **newArgs);
void getMyTime(struct timeval  *time);
double timeDifference(struct timeval  *start, struct timeval  *end);

#endif //CLIENTDATA

I am very new to this area and have looked over other questions but I’m not declaring and values in the headers, they are all function prototypes.
So lost!
It was all working before I added the #ifdef win32 stuff 🙁 but When I tried to change it back it still came up with these errors.

  • 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-06-12T05:33:48+00:00Added an answer on June 12, 2026 at 5:33 am

    Look carefully at your compilation command line:

    gcc client.c client.h clientdata.c clientdata.c -o client.exe
    
    1. You don’t need to pass header files to the compiler.
    2. You don’t want to pass the same source code twice (that’s causing the multiple definition errors, because all the extern functions in clientdata.c are defined twice).

    What you need is just:

    gcc client.c clientdata.c -o client.exe
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
This could be a duplicate question, but I have no idea what search terms
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am trying to loop through a bunch of documents I have to put
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example

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.