Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > problem with a makefile

Reply
Thread Tools

problem with a makefile

 
 
fabio
Guest
Posts: n/a
 
      03-09-2006
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..
 
Reply With Quote
 
 
 
 
Walter Roberson
Guest
Posts: n/a
 
      03-09-2006
In article <(E-Mail Removed)>,
fabio <(E-Mail Removed)> 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.
 
Reply With Quote
 
 
 
 
Walter Roberson
Guest
Posts: n/a
 
      03-09-2006
In article <duq69v$no1$(E-Mail Removed)>,
Walter Roberson <(E-Mail Removed)-cnrc.gc.ca> wrote:
>In article <(E-Mail Removed)>,
>fabio <(E-Mail Removed)> 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
 
Reply With Quote
 
Keith Thompson
Guest
Posts: n/a
 
      03-09-2006
fabio <(E-Mail Removed)> 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.velocityreviews.com/forums/(E-Mail Removed) <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.
 
Reply With Quote
 
fabio
Guest
Posts: n/a
 
      03-10-2006
Il Thu, 09 Mar 2006 21:37:45 +0000, Walter Roberson ha scritto:

> In article <duq69v$no1$(E-Mail Removed)>,
> Walter Roberson <(E-Mail Removed)-cnrc.gc.ca> wrote:
>>In article <(E-Mail Removed)>,
>>fabio <(E-Mail Removed)> 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!

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem in makefile raju2000myin@gmail.com C Programming 9 06-18-2007 10:07 PM
what is the problem about my makefile dolphin C Programming 6 04-16-2007 06:04 PM
A Problem with makefile. prasadjoshi124@gmail.com C Programming 3 11-29-2006 05:33 PM
javac vs Makefile problem ... for.fun@laposte.net Java 16 12-06-2005 06:09 PM
Is There A Problem With makefile() On Win32? John Abel Python 0 09-29-2003 06:12 PM



Advertisments