Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7896845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T07:59:53+00:00 2026-06-03T07:59:53+00:00

I’m trying to compile a very simple Hello world OpenGL 3.3 program using FreeGLUT.

  • 0

I’m trying to compile a very simple “Hello world” OpenGL 3.3 program using FreeGLUT. In all the tutorials I found, they include an header “gl3.h”. The problem is, I don’t have such header file.

$ ls -l /usr/include/GL/
total 2164
-rw-r--r-- 1 root root   8797 20 janv. 17:44 freeglut_ext.h
-rw-r--r-- 1 root root    681 20 janv. 17:44 freeglut.h
-rw-r--r-- 1 root root  26181 20 janv. 17:44 freeglut_std.h
-rw-r--r-- 1 root root 837247 27 janv. 12:55 glew.h
-rw-r--r-- 1 root root 656589 21 mars  18:07 glext.h
-rw-r--r-- 1 root root  84468 21 mars  18:07 gl.h
-rw-r--r-- 1 root root 128943 21 mars  18:07 gl_mangle.h
-rw-r--r-- 1 root root  17255 21 mars  18:07 glu.h
-rw-r--r-- 1 root root   3315 21 mars  18:07 glu_mangle.h
-rw-r--r-- 1 root root    639 20 janv. 17:44 glut.h
-rw-r--r-- 1 root root  62741 27 janv. 12:55 glxew.h
-rw-r--r-- 1 root root  43887 21 mars  18:07 glxext.h
-rw-r--r-- 1 root root  17170 21 mars  18:07 glx.h
-rw-r--r-- 1 root root   4706  3 févr. 13:33 glxint.h
-rw-r--r-- 1 root root   3463 21 mars  18:07 glx_mangle.h
-rw-r--r-- 1 root root   2086  3 févr. 13:33 glxmd.h
-rw-r--r-- 1 root root  80979  3 févr. 13:33 glxproto.h
-rw-r--r-- 1 root root  11246  3 févr. 13:33 glxtokens.h
drwxr-xr-x 2 root root   4096 14 avril 14:03 internal
-rw-r--r-- 1 root root   8497 21 mars  18:07 osmesa.h
-rw-r--r-- 1 root root  51274 21 mars  18:07 vms_x_fix.h
-rw-r--r-- 1 root root  59403 27 janv. 12:55 wglew.h
-rw-r--r-- 1 root root  41377 21 mars  18:07 wglext.h
-rw-r--r-- 1 root root   4468 21 mars  18:07 wmesa.h

In /usr/include/ I only have GL, GLES and GLES2. There is no GL3 as I found in some tutorials.

I’m running on Arch Linux x86_64 with a NVIDIA graphic card (nvidia closed-source driver).

Here is how I included OpenGL and FreeGLUT APIs in my program:

#define GL3_PROTOTYPES 1
#include <GL/gl.h>
#include <GL/freeglut.h>

But the code doesn’t compile:

$ g++ -pipe -g -Wall -Wextra -pedantic -I. -IHeaders -c Sources/Main.cpp -o Temp/Objects/Main.o 
Sources/Main.cpp: In function ‘int main(int, char**)’:
Sources/Main.cpp:107:59: error: ‘glVertexAttribPointer’ was not declared in this scope
Sources/Main.cpp:108:30: error: ‘glEnableVertexAttribArray’ was not declared in this scope
Sources/Main.cpp:114:35: error: ‘glUseProgram’ was not declared in this scope
Sources/Main.cpp:138:31: error: ‘glDisableVertexAttribArray’ was not declared in this scope

It seems I included the OpenGL 2 headers! But, again, I didn’t find any OpenGL 3 headers on my system, I looked at the Arch repository and AUR, unsuccessfully.

Thank you for your help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T07:59:55+00:00Added an answer on June 3, 2026 at 7:59 am

    You don’t need a GL3.h, the GL3.h just got rid of all deprecated features. So just include gl.h instead of gl3.h. Downloading and manually copyieng into /usr/include/GL/ is not a real solution, it works yes, but what happens if the add to the mesa package the gl3.h? You’re package manager will find conflicts. Better you add the gl3.h to your project or into your home directory and add it to the $PATh or use the -I flag.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am just trying to compile and run a very simple test program, but
I have a very simple example program that I am trying to compile, but
I am trying to cross-compile a very simple program for Android that worked with
I'm trying to compile a very simple program that makes a connection to a
I'm trying to compile a very simple program in Java 1.6 on Ubuntu Jaunty,
I'm trying to compile a very simple c++ code and get a linking error
I'm trying to build a very simple OpenGL-app under Ubuntu 10.04 (I have a
I'm trying to use AppWeb, and i wrote a very simple program to embed
I am trying to compile the following very very simple piece of source code:
I'm trying to crosscompile a very simple test program with functions of opencv. I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.