当我运行程序时,我收到以下错误
致命错误:找不到'gl / glx.h'文件
我正在尝试在我的mac上运行c ++ xll图形程序。我已经下载了Xquartz并用它在我的计算机上运行多个图形程序,现在我想弄清楚我缺少什么才能让这个程序运行。如果有人能指出我正确的方向那将是美好的!
谢谢
这是提供的make文件的副本
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
更新了Make文件仍在获取 致命错误'GL / glx.h'
答案 0 :(得分:0)
您需要使用选项-I/opt/X11/include
进行编译,并使用选项-L/opt/X11/lib -lGL -lX11
进行关联。