You are not logged in.

#1 2021-02-27 03:40:03

AngelicLolipop
Member
Registered: 2021-02-10
Posts: 9

[SOLVED] Compiling opengl issues

I am trying to learn opengl in C, but I have having some issues installing the header file glad/gl.h as shown to include here My program currently is minimal and just has the includes pretty much, and when I try to compile I get this:

main.c:6:10: fatal error: glad/gl.h: No such file or directory
    6 | #include <glad/gl.h>
      |          ^~~~~~~~~~~
compilation terminated.

So I am missing the glad/gl.h header file. When I use pkgfile gl.h or pkgfile glad, nothing comes up other than some opengl projects. Not sure how to get this header file... Is this header file even in the arch repo? Thanks in advance!

Last edited by AngelicLolipop (2021-02-28 03:38:21)

Offline

#2 2021-02-27 07:02:11

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,435

Re: [SOLVED] Compiling opengl issues

The tutorial you linked seems to rely on https://github.com/Dav1dde/glad (but their link is 502)

Offline

#3 2021-02-27 09:26:16

u666sa
Member
Registered: 2020-08-01
Posts: 70

Re: [SOLVED] Compiling opengl issues

Assuming you installed all the needed packages, you need to set GLPATH=/usr/lib

Add it to your /etc/environment so it's there and reboot

 1 #                                                                            
 2 # This file is parsed by pam_env module                                      
 3 #                                                                            
 4 # Syntax: simple "KEY=VAL" pairs on separate lines                           
 5 #                                                                            
 6                                                                              
 7 ####LC_ALL=en_US.UTF-8                                                       
 8 EDITOR=nano                                                                  
 9 _microarchitecture=29                                                        
10 CFLAGS="-march=westmere -mtune=westmere -02 -pipe -fno-plt"                  
11 CXXFLAGS="-march=westmere -mtune=westmere -02 -pipe -fno-plt"                
12 MAKEFLAGS="-j2"                                                              
13 CONFIG_SECURITY_APPARMOR=y                                                   
14 CONFIG_AUDIT=y                                                               
15 CONFIG_LSM="lockdown,yama,apparmor,bpf"                                      
16 PATH=/usr/local/cuda-8.0/bin:/usr/local/cuda-8.0/samples/bin/x86_64/linux/r> 
17 GLPATH=/usr/lib                                                              
18 CUDADIR=/usr/local/cuda

You can also prefix your compile command line like so

GLPATH=/usr/lib gcc ...... 

Offline

#4 2021-02-28 03:38:01

AngelicLolipop
Member
Registered: 2021-02-10
Posts: 9

Re: [SOLVED] Compiling opengl issues

I think I figured it out, I thought that this was in the glfw package, thanks for the help

Offline

#5 2021-07-04 16:52:32

CarloWood
Member
Registered: 2021-07-04
Posts: 2

Re: [SOLVED] Compiling opengl issues

This is marked as SOLVED - but no solution is added. That is annoying for people that run into the same problem hmm.

Offline

#6 2021-07-04 17:10:41

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,435

Re: [SOLVED] Compiling opengl issues

You need to install glad, linked in the 2nd post.
This is also kinda implied across the thread (me referencing it and the OP stating that he thought this was provided by glfw)

Offline

Board footer

Powered by FluxBB