From: <joh...@pp...> - 2001-01-10 14:35:35
|
Sami Kristeri Maisniemi <sma...@cc...> sanoi: > On Sun, 7 Jan 2001, Johan Olin wrote: > > > Hi, I've used the following simple makefile for my GL/glut adventures : > > > > ---------------------------------- > > TARGET = <Name of executable> > > SRCS = <source files> > > OBJS = ${SRCS:.c=.o} > > CC = gcc > > LDFLAGS = -lglut -lGL -lGLU -lXmu -lXext -lX11 -lXi -lm > > CFLAGS = -g > > > > ${TARGET} : ${OBJS} > > > > clean: > > -rm -f *.o *~ > > -rm -f ${TARGET} > > --------------------------------- > > In your case TARGET would be 'main' and SRCS would be main.c > > ie. > > TARGET = main > > SRCS = main.c > > > > As far as I know, the order of the libs in LDFLAGS doesn't matter .... > > > > BR: Jussi > > Thanks, > > I tried using the makefile mentioned above, but linking fails and prints > the following lines: > > gcc -lglut -lGL -lGLU -lXmu -lXext -lX11 -lXi -lm main.o -o main > /usr/bin/ld: cannot find -lXmu > collect2: ld returned 1 exit status > make: *** [main] Error 1 > > It seems that the compiler is not able to find any X-related libraries. > Could this be a common problem in Red Hat 7.0 Linux? Is someone able to > tell how the location of the libraries can be found out and how > the makefile should be modified? Hmmm ... you don't need to edit the makefile, but your linker configuration or/and your installation needs some tweaking .... as root, type : ldconfig -p It lists the libraries the linker finds ... If the libs are installed, but the linker can't find them you'll need to edit the file /etc/ld.so.conf and run ldconfig again .... Or/And, check the gcc documentation for info about environment variables that affect compiling/linking (info gcc). If none of the above helps; doublecheck that you've installed the libraries and try again .... If it still doesn't work ... I'm clueless :-( BR: Jussi > > Regards, Sami > > ------------------------------------------------------------------------- > Sami Maisniemi tel: +358 9 4580 854 > Helsinki University of Technology mobile: +358 40 7499 088 > Department of Electrical and email: sma...@cc... > Communication Engineering sam...@no... > ------------------------------------------------------------------------- > > > > > _______________________________________________ > Mesa3d-users mailing list > Mes...@li... > http://lists.sourceforge.net/mailman/listinfo/mesa3d-users > -- ________________________________________________________________ Ilmainen Internet @ http://www.nic.fi/ |