redbook examples

  • Follow


Has anyone recently compiled the redbook examples found here

http://opengl-redbook.com/code/

with the provided makefile?

I am pretty damn sure I have all the libraries needed installed from my
ubuntu repository, but get

shadowmap.c:49:21: error: helpers.h: No such file or directory
0
Reply Hadron 7/8/2007 11:39:14 PM

Am Mon, 09 Jul 2007 01:39:14 +0200 schrieb Hadron:

> Has anyone recently compiled the redbook examples found here
> 
> http://opengl-redbook.com/code/
> 
> with the provided makefile?
> 
> I am pretty damn sure I have all the libraries needed installed from my
> ubuntu repository, but get
> 
> shadowmap.c:49:21: error: helpers.h: No such file or directory

helper.h seems to be not a library-specific header. it should belong to 
the redbook examples.
so, look for it in the example folder and add "-I/path/to/the/folder" to 
the CXX_FLAGS variable in the makefile
0
Reply Simon 7/8/2007 11:50:54 PM


Simon Wollwage <wollwagesimon@yahoo.co.jp> writes:

> Am Mon, 09 Jul 2007 01:39:14 +0200 schrieb Hadron:
>
>> Has anyone recently compiled the redbook examples found here
>> 
>> http://opengl-redbook.com/code/
>> 
>> with the provided makefile?
>> 
>> I am pretty damn sure I have all the libraries needed installed from my
>> ubuntu repository, but get
>> 
>> shadowmap.c:49:21: error: helpers.h: No such file or directory
>
> helper.h seems to be not a library-specific header. it should belong to 
> the redbook examples.
> so, look for it in the example folder and add "-I/path/to/the/folder" to 
> the CXX_FLAGS variable in the makefile

You have compiled them?

There is no helpers.h.

(There is also no CXX_FLAGS variable in the makefile)

I am compiling on Ubuntu linux.


0
Reply Hadron 7/9/2007 12:52:11 AM

Am Mon, 09 Jul 2007 02:52:11 +0200 schrieb Hadron:

> Simon Wollwage <wollwagesimon@yahoo.co.jp> writes:
> 
>> Am Mon, 09 Jul 2007 01:39:14 +0200 schrieb Hadron:
>>
>>> Has anyone recently compiled the redbook examples found here
>>> 
>>> http://opengl-redbook.com/code/
>>> 
>>> with the provided makefile?
>>> 
>>> I am pretty damn sure I have all the libraries needed installed from
>>> my ubuntu repository, but get
>>> 
>>> shadowmap.c:49:21: error: helpers.h: No such file or directory
>>
>> helper.h seems to be not a library-specific header. it should belong to
>> the redbook examples.
>> so, look for it in the example folder and add "-I/path/to/the/folder"
>> to the CXX_FLAGS variable in the makefile
> 
> You have compiled them?
> 
> There is no helpers.h.
> 
> (There is also no CXX_FLAGS variable in the makefile)
> 
> I am compiling on Ubuntu linux.

I just downloaded them. Forget about the makefile. Just try this:

g++ the_example_you_want_to_compile.c -lGL -lGLU -lglut -o any_output_name

-- 
/(bb|[^b]{2})/
"Microsoft - We put the bill in billionaire"
0
Reply Simon 7/9/2007 9:17:13 AM

Simon Wollwage <wollwagesimon@yahoo.co.jp> writes:

> Am Mon, 09 Jul 2007 02:52:11 +0200 schrieb Hadron:
>
>> Simon Wollwage <wollwagesimon@yahoo.co.jp> writes:
>> 
>>> Am Mon, 09 Jul 2007 01:39:14 +0200 schrieb Hadron:
>>>
>>>> Has anyone recently compiled the redbook examples found here
>>>> 
>>>> http://opengl-redbook.com/code/
>>>> 
>>>> with the provided makefile?
>>>> 
>>>> I am pretty damn sure I have all the libraries needed installed from
>>>> my ubuntu repository, but get
>>>> 
>>>> shadowmap.c:49:21: error: helpers.h: No such file or directory
>>>
>>> helper.h seems to be not a library-specific header. it should belong to
>>> the redbook examples.
>>> so, look for it in the example folder and add "-I/path/to/the/folder"
>>> to the CXX_FLAGS variable in the makefile
>> 
>> You have compiled them?
>> 
>> There is no helpers.h.
>> 
>> (There is also no CXX_FLAGS variable in the makefile)
>> 
>> I am compiling on Ubuntu linux.
>
> I just downloaded them. Forget about the makefile. Just try this:
>
> g++ the_example_you_want_to_compile.c -lGL -lGLU -lglut -o
> any_output_name

Thanks for the replies. I'd already ditched the Makefile and made my
own.

I'm at a loss to explain how it can be so wrong considering the Linux
install base and nothing is mentioned in the errata.

Now I am in the process of sorting out differences between Mesa, glut,
freeglut and the nvidia-glx drivers. I lost my X this morning :(

FWIW and if anyone has problems with this, here is my Gcc Linux Makefile
for the opengl programming guide (redbook) code examples using C:

,----
| CC=gcc
| COMPILE.c=$(CC) $(CFLAGS) -c
| LINK.c=$(CC) $(CFLAGS) $(LDFLAGS)
| LDLIBS=$(EXTRALIBS)
| CFLAGS= -std=c99 -pedantic -Wall -D_GNU_SOURCE -g
| 
| GLUT = -lglut
| EXTRALIBS = $(GLUT) -lGLU -lGL -lXmu -lXext -lX11 -lm
| 
| PROGS =  \
| 		  aaindex aargb accanti accpersp alpha3D \
| 		  alpha bezcurve bezmesh bezsurf blendeqn \
| 		  checker clip colormat combiner cubemap \
| 		  cube dof double drawf feedback \
| 		  fogcoord fogindex fog font hello \
| 		  image light lines list material \
| 		  mipmap model movelight multisamp multitex \
| 		  mvarray pickdepth picksquare planet pointp \
| 		  polyoff polys quadric robot scene \
| 		  select shadowmap smooth stencil stroke \
| 		  surface surfpoints teapots tesswind tess \
| 		  texbind texgen texprox texsub texture3d \
| 		  texturesurf torus trim unproject varray \
| 		  wrap
| 
| all:	$(PROGS)
| 
| clean:
| 	rm -f $(PROGS)
`----

I installed freeglut and NOT mesa to make this compile and
work. Unfortunately a whole host of examples out there assume Mesa.







-- 
0
Reply Hadron 7/9/2007 10:59:56 AM

"Hadron" <hadronquark@gmail.com> wrote in message 
news:87vecthmfn.fsf@gmail.com...
> Simon Wollwage <wollwagesimon@yahoo.co.jp> writes:
>
>> Am Mon, 09 Jul 2007 02:52:11 +0200 schrieb Hadron:
>>
>>> Simon Wollwage <wollwagesimon@yahoo.co.jp> writes:
>>>
>>>> Am Mon, 09 Jul 2007 01:39:14 +0200 schrieb Hadron:
>>>>
>>>>> Has anyone recently compiled the redbook examples found here
>>>>>
>>>>> http://opengl-redbook.com/code/
>>>>>
>>>>> with the provided makefile?
>>>>>
>>>>> I am pretty damn sure I have all the libraries needed installed from
>>>>> my ubuntu repository, but get
>>>>>
>>>>> shadowmap.c:49:21: error: helpers.h: No such file or directory
>>>>
>>>> helper.h seems to be not a library-specific header. it should belong to
>>>> the redbook examples.
>>>> so, look for it in the example folder and add "-I/path/to/the/folder"
>>>> to the CXX_FLAGS variable in the makefile
>>>
>>> You have compiled them?
>>>
>>> There is no helpers.h.
>>>
>>> (There is also no CXX_FLAGS variable in the makefile)
>>>
>>> I am compiling on Ubuntu linux.
>>
>> I just downloaded them. Forget about the makefile. Just try this:
>>
>> g++ the_example_you_want_to_compile.c -lGL -lGLU -lglut -o
>> any_output_name
>
> Thanks for the replies. I'd already ditched the Makefile and made my
> own.
>
> I'm at a loss to explain how it can be so wrong considering the Linux
> install base and nothing is mentioned in the errata.
>
> Now I am in the process of sorting out differences between Mesa, glut,
> freeglut and the nvidia-glx drivers. I lost my X this morning :(
>
> FWIW and if anyone has problems with this, here is my Gcc Linux Makefile
> for the opengl programming guide (redbook) code examples using C:
>
> ,----
> | CC=gcc
> | COMPILE.c=$(CC) $(CFLAGS) -c
> | LINK.c=$(CC) $(CFLAGS) $(LDFLAGS)
> | LDLIBS=$(EXTRALIBS)
> | CFLAGS= -std=c99 -pedantic -Wall -D_GNU_SOURCE -g
> |
> | GLUT = -lglut
> | EXTRALIBS = $(GLUT) -lGLU -lGL -lXmu -lXext -lX11 -lm
> |
> | PROGS =  \
> |   aaindex aargb accanti accpersp alpha3D \
> |   alpha bezcurve bezmesh bezsurf blendeqn \
> |   checker clip colormat combiner cubemap \
> |   cube dof double drawf feedback \
> |   fogcoord fogindex fog font hello \
> |   image light lines list material \
> |   mipmap model movelight multisamp multitex \
> |   mvarray pickdepth picksquare planet pointp \
> |   polyoff polys quadric robot scene \
> |   select shadowmap smooth stencil stroke \
> |   surface surfpoints teapots tesswind tess \
> |   texbind texgen texprox texsub texture3d \
> |   texturesurf torus trim unproject varray \
> |   wrap
> |
> | all: $(PROGS)
> |
> | clean:
> | rm -f $(PROGS)
> `----
>
> I installed freeglut and NOT mesa to make this compile and
> work. Unfortunately a whole host of examples out there assume Mesa.
>
>


Assume Mesa in what way ? nvidia-glx should (does!) provide all the "real" 
OpenGL stuff you need.
-jbw


0
Reply jbwest 7/10/2007 2:10:27 AM

"jbwest" <jbwest@comcast.net> writes:

> "Hadron" <hadronquark@gmail.com> wrote in message 
> news:87vecthmfn.fsf@gmail.com...
>> Simon Wollwage <wollwagesimon@yahoo.co.jp> writes:
>>
>>> Am Mon, 09 Jul 2007 02:52:11 +0200 schrieb Hadron:
>>>
>>>> Simon Wollwage <wollwagesimon@yahoo.co.jp> writes:
>>>>
>>>>> Am Mon, 09 Jul 2007 01:39:14 +0200 schrieb Hadron:
>>>>>
>>>>>> Has anyone recently compiled the redbook examples found here
>>>>>>
>>>>>> http://opengl-redbook.com/code/
>>>>>>
>>>>>> with the provided makefile?
>>>>>>
>>>>>> I am pretty damn sure I have all the libraries needed installed from
>>>>>> my ubuntu repository, but get
>>>>>>
>>>>>> shadowmap.c:49:21: error: helpers.h: No such file or directory
>>>>>
>>>>> helper.h seems to be not a library-specific header. it should belong to
>>>>> the redbook examples.
>>>>> so, look for it in the example folder and add "-I/path/to/the/folder"
>>>>> to the CXX_FLAGS variable in the makefile
>>>>
>>>> You have compiled them?
>>>>
>>>> There is no helpers.h.
>>>>
>>>> (There is also no CXX_FLAGS variable in the makefile)
>>>>
>>>> I am compiling on Ubuntu linux.
>>>
>>> I just downloaded them. Forget about the makefile. Just try this:
>>>
>>> g++ the_example_you_want_to_compile.c -lGL -lGLU -lglut -o
>>> any_output_name
>>
>> Thanks for the replies. I'd already ditched the Makefile and made my
>> own.
>>
>> I'm at a loss to explain how it can be so wrong considering the Linux
>> install base and nothing is mentioned in the errata.
>>
>> Now I am in the process of sorting out differences between Mesa, glut,
>> freeglut and the nvidia-glx drivers. I lost my X this morning :(
>>
>> FWIW and if anyone has problems with this, here is my Gcc Linux Makefile
>> for the opengl programming guide (redbook) code examples using C:
>>
>> ,----
>> | CC=gcc
>> | COMPILE.c=$(CC) $(CFLAGS) -c
>> | LINK.c=$(CC) $(CFLAGS) $(LDFLAGS)
>> | LDLIBS=$(EXTRALIBS)
>> | CFLAGS= -std=c99 -pedantic -Wall -D_GNU_SOURCE -g
>> |
>> | GLUT = -lglut
>> | EXTRALIBS = $(GLUT) -lGLU -lGL -lXmu -lXext -lX11 -lm
>> |
>> | PROGS =  \
>> |   aaindex aargb accanti accpersp alpha3D \
>> |   alpha bezcurve bezmesh bezsurf blendeqn \
>> |   checker clip colormat combiner cubemap \
>> |   cube dof double drawf feedback \
>> |   fogcoord fogindex fog font hello \
>> |   image light lines list material \
>> |   mipmap model movelight multisamp multitex \
>> |   mvarray pickdepth picksquare planet pointp \
>> |   polyoff polys quadric robot scene \
>> |   select shadowmap smooth stencil stroke \
>> |   surface surfpoints teapots tesswind tess \
>> |   texbind texgen texprox texsub texture3d \
>> |   texturesurf torus trim unproject varray \
>> |   wrap
>> |
>> | all: $(PROGS)
>> |
>> | clean:
>> | rm -f $(PROGS)
>> `----
>>
>> I installed freeglut and NOT mesa to make this compile and
>> work. Unfortunately a whole host of examples out there assume Mesa.
>>
>>
>
>
> Assume Mesa in what way ? nvidia-glx should (does!) provide all the "real" 
> OpenGL stuff you need.
> -jbw
>
>

Like all the makefiles referencing non existing mesa libraries?

It's, as a nOOb, very confusing.

Why should nvidia-glx be providing the stuff I need? Does this mean
anything I link to will NOT work with ATI cards? Please, be patient with
me. There is a lot of stuff out there.

I assumed all the openGL stuff for compiling and linking would be card
neutral and that code then talks to the correct openGL for the Nvidia
card or ATI card at run time.

0
Reply Hadron 7/10/2007 4:17:01 PM

On Jul 10, 6:17 pm, Hadron <hadronqu...@gmail.com> wrote:
>
> I assumed all the openGL stuff for compiling and linking would be card
> neutral and that code then talks to the correct openGL for the Nvidia
> card or ATI card at run time.

Your assumption was correct...


--
<\___/>
/ O O \
\_____/  FTB.     Remove my socks for email address.

0
Reply fungus 7/10/2007 10:37:38 PM

"Hadron" <hadronquark@gmail.com> wrote in message 
news:87sl7wdyiq.fsf@gmail.com...
> "jbwest" <jbwest@comcast.net> writes:
>
>> "Hadron" <hadronquark@gmail.com> wrote in message
>> news:87vecthmfn.fsf@gmail.com...
>>> Simon Wollwage <wollwagesimon@yahoo.co.jp> writes:
>>>
>>>> Am Mon, 09 Jul 2007 02:52:11 +0200 schrieb Hadron:
>>>>
>>>>> Simon Wollwage <wollwagesimon@yahoo.co.jp> writes:
>>>>>
>>>>>> Am Mon, 09 Jul 2007 01:39:14 +0200 schrieb Hadron:
>>>>>>
>>>>>>> Has anyone recently compiled the redbook examples found here
>>>>>>>
>>>>>>> http://opengl-redbook.com/code/
>>>>>>>
>>>>>>> with the provided makefile?
>>>>>>>
>>>>>>> I am pretty damn sure I have all the libraries needed installed from
>>>>>>> my ubuntu repository, but get
>>>>>>>
>>>>>>> shadowmap.c:49:21: error: helpers.h: No such file or directory
>>>>>>
>>>>>> helper.h seems to be not a library-specific header. it should belong 
>>>>>> to
>>>>>> the redbook examples.
>>>>>> so, look for it in the example folder and add "-I/path/to/the/folder"
>>>>>> to the CXX_FLAGS variable in the makefile
>>>>>
>>>>> You have compiled them?
>>>>>
>>>>> There is no helpers.h.
>>>>>
>>>>> (There is also no CXX_FLAGS variable in the makefile)
>>>>>
>>>>> I am compiling on Ubuntu linux.
>>>>
>>>> I just downloaded them. Forget about the makefile. Just try this:
>>>>
>>>> g++ the_example_you_want_to_compile.c -lGL -lGLU -lglut -o
>>>> any_output_name
>>>
>>> Thanks for the replies. I'd already ditched the Makefile and made my
>>> own.
>>>
>>> I'm at a loss to explain how it can be so wrong considering the Linux
>>> install base and nothing is mentioned in the errata.
>>>
>>> Now I am in the process of sorting out differences between Mesa, glut,
>>> freeglut and the nvidia-glx drivers. I lost my X this morning :(
>>>
>>> FWIW and if anyone has problems with this, here is my Gcc Linux Makefile
>>> for the opengl programming guide (redbook) code examples using C:
>>>
>>> ,----
>>> | CC=gcc
>>> | COMPILE.c=$(CC) $(CFLAGS) -c
>>> | LINK.c=$(CC) $(CFLAGS) $(LDFLAGS)
>>> | LDLIBS=$(EXTRALIBS)
>>> | CFLAGS= -std=c99 -pedantic -Wall -D_GNU_SOURCE -g
>>> |
>>> | GLUT = -lglut
>>> | EXTRALIBS = $(GLUT) -lGLU -lGL -lXmu -lXext -lX11 -lm
>>> |
>>> | PROGS =  \
>>> |   aaindex aargb accanti accpersp alpha3D \
>>> |   alpha bezcurve bezmesh bezsurf blendeqn \
>>> |   checker clip colormat combiner cubemap \
>>> |   cube dof double drawf feedback \
>>> |   fogcoord fogindex fog font hello \
>>> |   image light lines list material \
>>> |   mipmap model movelight multisamp multitex \
>>> |   mvarray pickdepth picksquare planet pointp \
>>> |   polyoff polys quadric robot scene \
>>> |   select shadowmap smooth stencil stroke \
>>> |   surface surfpoints teapots tesswind tess \
>>> |   texbind texgen texprox texsub texture3d \
>>> |   texturesurf torus trim unproject varray \
>>> |   wrap
>>> |
>>> | all: $(PROGS)
>>> |
>>> | clean:
>>> | rm -f $(PROGS)
>>> `----
>>>
>>> I installed freeglut and NOT mesa to make this compile and
>>> work. Unfortunately a whole host of examples out there assume Mesa.
>>>
>>>
>>
>>
>> Assume Mesa in what way ? nvidia-glx should (does!) provide all the 
>> "real"
>> OpenGL stuff you need.
>> -jbw
>>
>>
>
> Like all the makefiles referencing non existing mesa libraries?
>
> It's, as a nOOb, very confusing.
>
> Why should nvidia-glx be providing the stuff I need? Does this mean
> anything I link to will NOT work with ATI cards? Please, be patient with
> me. There is a lot of stuff out there.
>
> I assumed all the openGL stuff for compiling and linking would be card
> neutral and that code then talks to the correct openGL for the Nvidia
> card or ATI card at run time.
>

 You are correct -- as long as you use the proper OpenGL header syntax, and 
don't include any MESA stuff -by name-.
If you have nvidia-glx (or ati devkit) installed on your Linux box, they 
suercede and replace MESA -- if you install Mesa on top of them, it will 
just bess everything up and neither will work right.

So, which "non existing mesa libraries" do the makefiles reference? You 
should typically need

-lGLU -lGL -lXm -lX11 -lm more or less as libraries to link with.

if you explicitly link with -lMesaGLU, fore example, then you aren't 
portable to non-mesa installations.

nVidia and ATI "driver" installs on linux *replace* -lGL and -lGLU default 
Mesa installations with their own.

They also replace the include files "gl.h and "glx.h"" with their own.

-jbw


0
Reply jbwest 7/11/2007 2:04:20 AM

"jbwest" <jbwest@comcast.net> writes:

>
>  You are correct -- as long as you use the proper OpenGL header syntax, and 
> don't include any MESA stuff -by name-.

This was the problem then : the example code I had did indeed include
mesa stuff by name

e.g -lMesaGLU

Amazing how messy "releases" of examples like this can slow up a
beginner. It took me the bones of 8 hours to get to a stage where I
could compile the red book examples - including loss of Linux display
.....

The fact that the redbook doesnt come with a working Linux makefile is
somewhat surprising too.

0
Reply Hadron 7/11/2007 11:22:30 AM

9 Replies
230 Views

(page loaded in 0.369 seconds)

Similiar Articles:







7/27/2012 9:34:28 AM


Reply: