02-28-07 06:17 PM
Hi,
I'm trying to create a makefile for a program.. but I'm getting an
error message when the compiler tries to link everything together..
Here's the make file and file structure:
btw, the code uses log function.. could that be the problem? yet I
dont see that particular error..
Thanks a lot for your help.
-fbm
-----
all: simul
simul: dllist.o random_functions.o event_functions.o main.o
gcc -c dllist.o random_functions.o event_functions.o main.o -o simul
dllist.o: dllist.c dllist.h
gcc -c dllist.c
random_functions.o: random_functions.c random_functions.h
gcc -c random_functions.c
event_functions.o: event_functions.c event_functions.h
gcc -c event_functions.c
main.o: main.c main.h
gcc -c main.c
clean:
rm -rf *o simul
-----
Now, the error I get is the following:
$ make clean
rm -rf *o simul
Fernando@FERLAPTOP ~/CSC579/simul1
$ make all
gcc -c dllist.c
gcc -c random_functions.c
gcc -c event_functions.c
gcc -c main.c
main.c: In function `main':
main.c:7: warning: passing arg 2 of `gettimeofday' from incompatible
pointer type
main.c:99: warning: passing arg 2 of `gettimeofday' from incompatible
pointer type
gcc -c dllist.o random_functions.o event_functions.o main.o -o simul
gcc: dllist.o: linker input file unused because linking not done
gcc: random_functions.o: linker input file unused because linking not
done
gcc: event_functions.o: linker input file unused because linking not
done
gcc: main.o: linker input file unused because linking not done
gcc: dllist.o: linker input file unused because linking not done
The warnings are fine, since this is cygwin complaining.. it compiles
fine in a linux machine. Now, the dependency relationship of the files
is the following..
-main.c headers:
#include "main.h"
-main.h headers:
#include "dllist.h"
#include "event_functions.h"
-event_functions.c headers:
#include "event_functions.h"
-event_functions.h headers:
#include "dllist.h"
#include "random_functions.h"
- random_functions.c headers
#include "random_functions.h"
-random_functions.h headers
(none)
-dllist.c headers:
#include "dllist.h"
-dllist.h headers:
(none)
[ Post a follow-up to this message ]
|