problem with a makefile

Discussion in 'C Programming' started by fabio, Mar 9, 2006.

  1. fabio

    fabio Guest

    http://rafb.net/paste/results/zJOE1P93.html

    it's all there! any help would be appreciated..
    bye!

    p.s. but sure i can paste it here too! :)
    START FILE:

    all: client server


    server: server.o mymutex.o error.o changedir.o
    gcc -o server -lpthread server.o mymutex.o error.o changedir.o

    server.o: server.c error.h debug.h defines.h server.h
    gcc -g -DDEBUG -c server.c

    client: client.o mymutex.o copia.o error.o
    gcc -o client -lpthread client.o mymutex.o copia.o error.o c_transfer.o

    client.o: client.c client.h
    gcc -g -DDEBUG -DCLIENT -c client.c

    c_transfer.o: c_transfer.c client.h
    gcc -g -DDEBUG -DCLIENT -c c_transfer.c

    mymutex.o: mymutex.c mymutex.h server.h
    gcc -g -DDEBUG -c mymutex.c

    error.o: error.c error.h debug.h defines.h server.h
    gcc -g -DDEBUG_ERROR -c error.c

    copia.o: copia.c error.h debug.h defines.h
    gcc -g -DDEBUG -DCLIENT -c copia.c

    changedir.o: changedir.c error.h debug.h defines.h server.h
    gcc -g -DDEBUG -DCLIENT -c changedir.c


    clean:
    /bin/rm -f client server client.o server.o mymutex.o copia.o changedir. o c_transfer.o

    END FILE

    this is the error:
    faz@debian:/progetto/prova2$ make
    gcc -g -DDEBUG -DCLIENT -c client.c
    client.c: In function `main':
    client.c:155: warning: assignment makes pointer from integer without a cast
    gcc -g -DDEBUG -c mymutex.c
    gcc -g -DDEBUG -DCLIENT -c copia.c
    gcc -o client -lpthread client.o mymutex.o copia.o error.o c_transfer.o
    gcc: c_transfer.o: No such file or directory
    make: *** [client] Error 1

    so... why it can't found c_transfer.o? seems like is not been compiled..
    fabio, Mar 9, 2006
    #1
    1. Advertising

  2. In article <>,
    fabio <> wrote:

    >p.s. but sure i can paste it here too! :)
    >START FILE:


    >all: client server


    Makefiles are not part of the C standard, and discussions of make
    are better made in a newsgroup specific to your programming
    environment or specific to the tool suite you are using.
    --
    Programming is what happens while you're busy making other plans.
    Walter Roberson, Mar 9, 2006
    #2
    1. Advertising

  3. In article <duq69v$no1$>,
    Walter Roberson <-cnrc.gc.ca> wrote:
    >In article <>,
    >fabio <> wrote:


    >>all: client server


    >Makefiles are not part of the C standard


    Off-topic:

    >>client: client.o mymutex.o copia.o error.o
    >> gcc -o client -lpthread client.o mymutex.o copia.o error.o c_transfer.o


    Notice you are creating "client" based upon several .o files, but
    not all of the .o files are listed as dependancies in the "client:" line.
    --
    "No one has the right to destroy another person's belief by
    demanding empirical evidence." -- Ann Landers
    Walter Roberson, Mar 9, 2006
    #3
  4. fabio <> writes:
    > http://rafb.net/paste/results/zJOE1P93.html
    >
    > it's all there! any help would be appreciated..
    > bye!
    >
    > p.s. but sure i can paste it here too! :)
    > START FILE:
    >
    > all: client server

    [snip]
    > clean:
    > /bin/rm -f client server client.o server.o mymutex.o copia.o changedir. o c_transfer.o
    >
    > END FILE


    > this is the error:
    > faz@debian:/progetto/prova2$ make
    > gcc -g -DDEBUG -DCLIENT -c client.c
    > client.c: In function `main':
    > client.c:155: warning: assignment makes pointer from integer without a cast
    > gcc -g -DDEBUG -c mymutex.c
    > gcc -g -DDEBUG -DCLIENT -c copia.c
    > gcc -o client -lpthread client.o mymutex.o copia.o error.o c_transfer.o
    > gcc: c_transfer.o: No such file or directory
    > make: *** [client] Error 1
    >
    > so... why it can't found c_transfer.o? seems like is not been compiled..


    Sorry, we don't do Makefiles here. You might try
    comp.unix.programmer. (I think I see the problem, but I'm not going
    to go into the details in this newsgroup; if you post to
    comp.unix.programmer, I'll answer there if somebody else doesn't beat
    me to it. <OT>Hint: Ask yourself whether "client" depends on
    "c_transfer.o", and if so, whether you've said so.</OT>)

    You should fix the warning in client.c. You haven't shown us the C
    source, so it's impossible to be certain, but a common cause of that
    message is that you're calling malloc() without the required
    "#include <stdlib.h>". (Resist the temptation to correct the problem
    by adding a cast; that would mask the error without fixing it.)

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
    We must do something. This is something. Therefore, we must do this.
    Keith Thompson, Mar 9, 2006
    #4
  5. fabio

    fabio Guest

    Il Thu, 09 Mar 2006 21:37:45 +0000, Walter Roberson ha scritto:

    > In article <duq69v$no1$>,
    > Walter Roberson <-cnrc.gc.ca> wrote:
    >>In article <>,
    >>fabio <> wrote:

    >
    >>>all: client server

    >
    >>Makefiles are not part of the C standard

    >
    > Off-topic:
    >
    >>>client: client.o mymutex.o copia.o error.o
    >>> gcc -o client -lpthread client.o mymutex.o copia.o error.o c_transfer.o

    >
    > Notice you are creating "client" based upon several .o files, but
    > not all of the .o files are listed as dependancies in the "client:" line.


    Oh yes, i see..
    thx both of you for response, and sorry if i was off-topic!
    Bye!
    fabio, Mar 10, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    16
    Views:
    1,139
  2. John Abel
    Replies:
    0
    Views:
    294
    John Abel
    Sep 29, 2003
  3. A Problem with makefile.

    , Nov 29, 2006, in forum: C Programming
    Replies:
    3
    Views:
    296
    CBFalconer
    Nov 29, 2006
  4. dolphin

    what is the problem about my makefile

    dolphin, Apr 16, 2007, in forum: C Programming
    Replies:
    6
    Views:
    356
    Kenny McCormack
    Apr 16, 2007
  5. problem in makefile

    , Jun 18, 2007, in forum: C Programming
    Replies:
    9
    Views:
    1,358
    CBFalconer
    Jun 18, 2007
Loading...

Share This Page