本文介绍了安装Xquartz后在Mac上找不到致命错误'GL/glx.h'文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我运行程序时,出现以下错误

When i run the program i get the following error

严重错误:找不到'GL/glx.h'文件

fatal error: 'Gl/glx.h' file not found

我正在尝试在Mac上运行c ++ xll图形程序.我已经下载了Xquartz,并用它来在计算机上运行多个图形程序,现在我试图找出我所缺少的,以便使该程序运行.如果有人能指出我正确的方向,那就太好了!

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!

谢谢

这是所提供的制作文件的副本

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

更新了使文件仍在获取致命错误'GL/glx.h'

Updated Make file still getting fatal error 'GL/glx.h'

更新的生成文件的图片

推荐答案

您需要使用选项 -I/opt/X11/include 进行编译,并使用选项 -L/进行链接opt/X11/lib -lGL -lX11 .

You need to compile with the option -I/opt/X11/include and link with the options -L/opt/X11/lib -lGL -lX11.

这篇关于安装Xquartz后在Mac上找不到致命错误'GL/glx.h'文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-17 20:14