Subject: Re: error in linking with glut.(undefined _glutSawpBuffers)
To: Richard Rauch <rkr@rkr.kcnet.com>
From: Richard PLOIX <richard.ploix@fr.adp.com>
List: netbsd-help
Date: 06/14/2000 19:08:33
hello,
I try your Makefile, and it is not so good.
read at the lines 11111 and 22222 and 33333.
At 14:41 31/05/00 -0500, you wrote:
>Does the program use any other GLUT calls? If so, and if you delete the
>call(s) to glutSwapBuffers(), what happens when you try to compile? (The
>purpose of this question is to determine whether you are actually linking
>against the glut library; the error SOUNDS like you have somehow not
>linked against it.)
>
>I seem to need the Xmu and Xext libraries as well, in order to produce a
>usable program (at least with Mesa 3.0 and 3.1). Failure to link with
>these should in no way cause the problem that you saw, however.
>
>You might also try a less ``fancy'', but more direct, Makefile. If you
>are trying to compile a pair of source files, cube.c and main.c, you might
>write your Makefile as follows:
>
> /~~~ Makefile
>
>IDIR = -I/usr/X11/include
>LDIR = -L/usr/X11R6/lib
>XLIBS = -lX11 -lXmu -lXext
>GLBASE = -lglut -lGLU -lGL
>CC = gcc -O2 -Wall
>COMP = $(CC) -c
>LINK = $(CC)
>
>all : cube
>
>cube : cube.o main.o
11111 > $(LINK) -o cube cube.o main.o $(LDIR) $(GLBASE) $(XLIBS) -lm
>
>cube.o : cube.c
22222 > $(COMP) $(IDIR) -o cube.o cube.c
>
>main.o : main.c
33333 > $(COMP) $(IDIR) -o main.o main.c
>
>clean :
> rm -f *.o cube *~
>
> \___ Makefile
>
>(The above is derived from a Makefile that I used for a graphics course
>last fall---it had to work on my machine (NetBSD) and the lab machines
>(SGI boxes). For small projects, keeping the Makefiles down to basics
>isn't really any more work, and you get the bonus of knowing that the
>Makefile is transportable to other systems. Of course, if you start
>working on larger programs (more than a few source files), you probably
>will want to make more use of your local make's special features.)
>
>(Note that the indented lines are indented by _tab_ characters, not
>spaces. Many makes require tab characters; none refuse to accept
>tab-indented lines.)
>
>
>If you just have a cube.c, remove the main.o : main.c production, and
>delete references to main.o in the cube : cube.o main.o production. If
>you are using C++ rather than C, changes the CC line to use g++ in place
>of gcc.
>
>
>Let me know if you try any of the above, and if so what results you get.
>
>(ramble)
>
I use make cube.
I have an error at the lines 11111, 22222, 33333 : need an operator.
I try to perfect my old Makefile like this :
/--------- Makefile
WARNS=2
PROG=cube
NOMAN=noman
CPPFLAGS+=-I/usr/X11R6/include
LDFLAGS+=-L/usr/X11R6/lib
LDADD+=-lX11
LDADD+=-lXmu
LDADD+=-lXext
LDADD+=-lglut
LDADD+=-lGLU
LDADD+=-lGL
LDADD+=-lm
\----------------- Makefile
this one can't find the lib GL,
I hade -lGL to the line just over and this is good.
it seems that the line n-1 is ignore.
thank's.
regards.
R.
>
> "I probably don't know what I'm talking about." --rkr@rkr.kcnet.com
>
>
>