title: Compiling Error /usr/bin/ld: cannot open output file bin/server: No such file or directory
body: <p>I'm trying to compile my program C using makefile in ubuntu. But I dont know whats the problem in it. And there is an error which I can't fix. </p>
  
  <pre><code>gcc -Wall -I. -pthread -ggdb -g -O0  -o bin/server server/message_queue.o server/client_thread.o server/server.o server/file.o server/datatypes.o common/datatypes.o common/error.o common/socket.o
  /usr/bin/ld: cannot open output file bin/server: No such file or directory
  collect2: error: ld returned 1 exit status
  make: *** [bin/server] Error 1
  </code></pre>
  
  <p>here is a makefile:</p>
  
  <pre><code>CC=gcc
  CFLAGS=-Wall -I. -pthread -ggdb -g -O0
  SERVER_OBJ=\
   server/message_queue.o \
   server/client_thread.o \
   server/server.o \
   server/file.o \
   server/datatypes.o
  
  COMMON_OBJ=\
   common/datatypes.o \
   common/error.o \
   common/socket.o
  
  CLIENT_OBJ=\
   client/send_thread.o \
   client/recv_thread.o \
   client/terminal_thread.o \
   client/client.o \
   client/datatypes.o
  
  BIN=bin
  
  all: server client
  
  server: $(BIN)/server
  client: $(BIN)/client
  
  $(BIN)/server: $(SERVER_OBJ) $(COMMON_OBJ)
   $(CC) $(CFLAGS) $(SERVER_CFLAGS) -o $@ $^
  
  $(BIN)/client: $(CLIENT_OBJ) $(COMMON_OBJ)
   $(CC) $(CFLAGS) $(CLIENT_CFLAGS) -o $@ $^
  
  %.o: %.c
   $(CC) $(CFLAGS) -c -o $@ $^
  
  clean:
   rm -f server
  </code></pre>
  
  <p>May be I forgot to install somthing for linux?</p>