Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

client server program in C

Tags:

c

I have written a simple client server program in which server accepts messages from clients and prints their details (hard coded for my assignment). I had written this at first on a Linux (Fedora) machine, and it was working perfectly fine. But when I try to compile the server code on my mac, it doesn't work.

Here is the message after compilation:

Undefined symbols for architecture x86_64:
  "_error", referenced from:
      _main in cc3O1167.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status

Can anyone help me out with this?

like image 544
user2442462 Avatar asked Oct 04 '22 23:10

user2442462


1 Answers

Put this at the top of your main file:

#ifdef __APPLE__
#  define error printf
#endif
like image 147
perreal Avatar answered Oct 13 '22 10:10

perreal