问题
When i run the program i get the following error
fatal error: 'Gl/glx.h' file not found
I am attempting to run a c++ xll graphics program on my mac. I have already downloaded Xquartz and used it to run multiple graphics programs on my computer and now i am trying to figure out what i'm missing in order to get this program to run. if anybody can point me in the right direction it would be wonderful!
Thanks
here is a copy of the make file provided
1 ## If you receive XRR errors, include -lXrandr option on LFLAGS line
2 all: atrace
3 ##LIB = ./libggfonts.so
4 LIB = ./libggfonts.a
5 LFLAGS = -lX11 -lGLU -lGL -lm #-lXrandr
6 CFLAGS = -O2 -Wall -Wextra
7 SOURCE = atrace.cpp init.cpp scene.cpp render.cpp sphere.cpp ppm.cpp log.cpp \
8 vector.cpp input.cpp files.cpp perlin.cpp texture.cpp divide.cpp \
9 cubemap.cpp matrix.cpp fresnel.cpp haze.cpp animate.cpp \
10 photons.cpp subsurf.cpp
11
12 #all: atrace atrace.o init.o scene.o render.o sphere.o ppm.o log.o \
13 # vector.o input.o files.o perlin.o texture.o divide.o \
14 # cubemap.o matrix.o fresnel.o haze.o animate.o
15 #
16 #atrace: $(SOURCE) fonts.h defs.h ppm.h extern.h bvh.h animate.h $(LIB)
17 # g++ $(CFLAGS) $(SOURCE) $(LFLAGS) $(LIB) -o atrace
18
19 atrace: atrace.o init.o scene.o render.o sphere.o ppm.o log.o \
20 vector.o input.o files.o perlin.o texture.o divide.o \
21 cubemap.o matrix.o fresnel.o haze.o animate.o photons.o subsurf.o \
22 defs.h ppm.h extern.h bvh.h animate.h
23 g++ atrace.o init.o scene.o render.o sphere.o ppm.o log.o vector.o \
24 input.o files.o perlin.o texture.o divide.o cubemap.o matrix.o fresnel.o \
25 haze.o animate.o photons.o subsurf.o $(LIB) -oatrace $(LFLAGS)
26
27
28 atrace.o: atrace.cpp defs.h ppm.h extern.h bvh.h animate.h
29 g++ atrace.cpp -c $(CFLAGS) $(LFLAGS)
30 init.o: init.cpp defs.h
31 g++ init.cpp -c $(CFLAGS) $(LFLAGS)
32 scene.o: scene.cpp defs.h
33 g++ scene.cpp -c $(CFLAGS) $(LFLAGS)
34 render.o: render.cpp defs.h
35 g++ render.cpp -c $(CFLAGS) $(LFLAGS)
36 sphere.o: sphere.cpp defs.h
37 g++ sphere.cpp -c $(CFLAGS) $(LFLAGS)
38 ppm.o: ppm.cpp defs.h ppm.h
39 g++ ppm.cpp -c $(CFLAGS) $(LFLAGS)
40 log.o: log.cpp defs.h
41 g++ log.cpp -c $(CFLAGS) $(LFLAGS)
42 vector.o: vector.cpp defs.h
43 g++ vector.cpp -c $(CFLAGS) $(LFLAGS)
44 input.o: input.cpp defs.h
45 g++ input.cpp -c $(CFLAGS) $(LFLAGS)
46 files.o: files.cpp defs.h files.h
47 g++ files.cpp -c $(CFLAGS) $(LFLAGS)
48 perlin.o: perlin.cpp defs.h
49 g++ perlin.cpp -c $(CFLAGS) $(LFLAGS)
50 texture.o: texture.cpp defs.h
51 g++ texture.cpp -c $(CFLAGS) $(LFLAGS)
52 divide.o: divide.cpp defs.h bvh.h
53 g++ divide.cpp -c $(CFLAGS) $(LFLAGS)
54 cubemap.o: cubemap.cpp defs.h
55 g++ cubemap.cpp -c $(CFLAGS) $(LFLAGS)
56 matrix.o: matrix.cpp defs.h
57 g++ matrix.cpp -c $(CFLAGS) $(LFLAGS)
58 fresnel.o: fresnel.cpp defs.h
59 g++ fresnel.cpp -c $(CFLAGS) $(LFLAGS)
60 haze.o: haze.cpp defs.h
61 g++ haze.cpp -c $(CFLAGS) $(LFLAGS)
62 animate.o: animate.cpp defs.h animate.h ppm.h
63 g++ animate.cpp -c $(CFLAGS) $(LFLAGS)
64 photons.o: photons.cpp defs.h
65 g++ photons.cpp -c $(CFLAGS) $(LFLAGS)
66 subsurf.o: subsurf.cpp defs.h
67 g++ subsurf.cpp -c $(CFLAGS) $(LFLAGS)
68
69 clean:
70 rm -f atrace
71 rm -f *.o
Updated Make file still getting fatal error 'GL/glx.h'
picture of updated make file
回答1:
You need to compile with the option -I/opt/X11/include
and link with the options -L/opt/X11/lib -lGL -lX11
.
来源:https://stackoverflow.com/questions/40186686/fatal-error-gl-glx-h-file-not-found-on-mac-after-xquartz-is-installed