This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

makefile


Hi!

(Sorry! A new copy with this mail WITH the Makefile)

I have some problems with the attached Makefile:

When I compile and link all as in the rule uppg4: everything works fine,
but I do want to split up compiling and linking, so I can divide my huge
main file uppg4.c into different objectives s.a. uppg4.o, myrnd.0 and so
on, to link them together later. Also I need to check for errors during my
development.

So I divided everything up, using rules uppg41.o: and uppg41:

Now I encounter the errors:

--------------------------------------------------------------------
fraggel39> make uppg41
gcc -I/users/mdstud/graf/old1999/OPENGL99 -I/usr/X11/include -pipe
-fpic -O3 -DSHM -c  -c  uppg4.c
gcc -O3 -c myrnd.c
gcc -L/usr/openwin/lib -L/opt/SUNWmotif/lib
-L/usr/src/md/pd/X11/libs/glut-3.7/lib/glut
-L/usr/src/md/pd/X11/libs/glut-3.7/lib/mui -R/usr/openwin/lib
-R/usr/local/lib -R/usr/X11/lib -R/opt/SUNWmotif/lib -lmui -lglut -lGLU
-lGL -lm -L/usr/ucblib -R/usr/ucblib -lX11 -lXm -lXmu -lXext -lnsl
-lsocket -lucb -lgen -o uppg4 uppg4.o myrnd.o
Undefined                       first referenced
 symbol                             in file
glutCreateWindow                    uppg4.o
glutMainLoop                        uppg4.o
glutDisplayFunc                     uppg4.o
glutReshapeFunc                     uppg4.o
glutMouseFunc                       uppg4.o
glutInitDisplayMode                 uppg4.o
glutMotionFunc                      uppg4.o
glutPostRedisplay                   uppg4.o
glutInitWindowSize                  uppg4.o
ld: fatal: Symbol referencing errors. No output written to uppg4
*** Error code 1
make: Fatal error: Command failed for target `uppg41'
--------------------------------------------------------------------

and I don't know what's wrong? Everything is included and linked just as
it should be supposed to, but the libraryfunctions in glut doesn't seem to
be found at all!

There must be a way to divide large items up...

___M_V_H______________Dr_Xem@cs________________lksign v2.0__

"As men's prayers are a disease of the will, so are their creeds
a disease of the intellect." - [Ralph Waldo Emerson]

Dr_Xemacs, the one and only!         (aka Lars Kristiansson)
md8lars@mdstud.chalmers.se               dr_xemacs@telia.com
http://www.mdstud.chalmers.se/~md8lars        ICQ : 25152178


___M_V_H______________Dr_Xem@cs________________lksign v2.0__

En dag kommer vi att se tillbaka på den här stunden,
skratta nervöst och snabbt byta ämne. - [Metro]

Dr_Xemacs, the one and only!         (aka Lars Kristiansson)
md8lars@mdstud.chalmers.se               dr_xemacs@telia.com
http://www.mdstud.chalmers.se/~md8lars        ICQ : 25152178


# se graf/SUNLINK. På kursen var SUNLINK placerad i kursens bin/
# De fyra första variablerna är hämtade från SUNLINK
# SUNLINK klarade inte av att inkludera paket.

OURGL_LIB	= /usr/openwin/lib
OURGL_INC	= /users/mdstud/graf/old1999/OPENGL99
OURGLUT		= /usr/src/md/pd/X11/libs/glut-3.7/lib/glut
OURMUI		= /usr/src/md/pd/X11/libs/glut-3.7/lib/mui

CC		= gcc

INCLUDES	= -I$(OURGL_INC) -I/usr/X11/include 
LIBS1		= -L$(OURGL_LIB) -L/opt/SUNWmotif/lib
LIBS2		= -L$(OURGLUT) -L$(OURMUI)
CHUNK1		= -R$(OURGL_LIB) -R/usr/local/lib
CHUNK2		= -R/usr/X11/lib -R/opt/SUNWmotif/lib
LIBS3		= -lmui -lglut -lGLU -lGL -lm 
CHUNK3		= -L/usr/ucblib -R/usr/ucblib
LIBS4		= -lX11 -lXm -lXmu -lXext -lnsl -lsocket -lucb -lgen

CFLAGS		= $(INCLUDES) -pipe -fpic -O3 -DSHM -c 
C1FLAGS		= $(INCLUDES) $(CHUNK1) $(CHUNK2) $(CHUNK3) -fpic -O3 -DSHM -c 
C2FLAGS		= -O3 -c 
LFLAGS		= $(LIBS1) $(LIBS2) $(CHUNK1) $(CHUNK2)\
		  $(LIBS3) $(CHUNK3) $(LIBS4)

all: uppg4

uppg4: myrnd.o
	$(CC) $(INCLUDES) -pipe -fpic -O3 -DSHM uppg4.c $(LFLAGS) \
	myrnd.o -o uppg4

uppg41: uppg4.o myrnd.o
	$(CC) $(LFLAGS) -o uppg4 uppg4.o myrnd.o

uppg41.o: uppg4.c
	$(CC) $(C1FLAGS) uppg4.c

myrnd.o: myrnd.c myrnd.h
	$(CC) $(C2FLAGS) myrnd.c

clean:
	rm *.o

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]