Compile OpenGL Program (Missing GL/gl.h)





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







46















I am a complete Linux/Ubuntu noob, so I apologize for any dumb portions of this question or follow up ones.



I am trying to get a program that my software engineering class's group wrote onto my home computer. At school, we have Linux, and it will compile and run fine there. I downloaded VMWare, installed Ubuntu on a virtual machine, and now am trying to get my program to open.



When ever I try to run my make file however, I get an error that says



gcc -I../include -pthread -O1 -c rain.c
In file included from rain.c:19:0:
../include/GL/glfw.h:176:21: fatal error: GL/gl.h: No such file or directory
compilation terminated.
make: *** [rain.o] Error 1


Would anyone happen to know why it can't find this file, when it can on my school computers? And what I'd need to do to download it or get it in the right spot?










share|improve this question































    46















    I am a complete Linux/Ubuntu noob, so I apologize for any dumb portions of this question or follow up ones.



    I am trying to get a program that my software engineering class's group wrote onto my home computer. At school, we have Linux, and it will compile and run fine there. I downloaded VMWare, installed Ubuntu on a virtual machine, and now am trying to get my program to open.



    When ever I try to run my make file however, I get an error that says



    gcc -I../include -pthread -O1 -c rain.c
    In file included from rain.c:19:0:
    ../include/GL/glfw.h:176:21: fatal error: GL/gl.h: No such file or directory
    compilation terminated.
    make: *** [rain.o] Error 1


    Would anyone happen to know why it can't find this file, when it can on my school computers? And what I'd need to do to download it or get it in the right spot?










    share|improve this question



























      46












      46








      46


      20






      I am a complete Linux/Ubuntu noob, so I apologize for any dumb portions of this question or follow up ones.



      I am trying to get a program that my software engineering class's group wrote onto my home computer. At school, we have Linux, and it will compile and run fine there. I downloaded VMWare, installed Ubuntu on a virtual machine, and now am trying to get my program to open.



      When ever I try to run my make file however, I get an error that says



      gcc -I../include -pthread -O1 -c rain.c
      In file included from rain.c:19:0:
      ../include/GL/glfw.h:176:21: fatal error: GL/gl.h: No such file or directory
      compilation terminated.
      make: *** [rain.o] Error 1


      Would anyone happen to know why it can't find this file, when it can on my school computers? And what I'd need to do to download it or get it in the right spot?










      share|improve this question
















      I am a complete Linux/Ubuntu noob, so I apologize for any dumb portions of this question or follow up ones.



      I am trying to get a program that my software engineering class's group wrote onto my home computer. At school, we have Linux, and it will compile and run fine there. I downloaded VMWare, installed Ubuntu on a virtual machine, and now am trying to get my program to open.



      When ever I try to run my make file however, I get an error that says



      gcc -I../include -pthread -O1 -c rain.c
      In file included from rain.c:19:0:
      ../include/GL/glfw.h:176:21: fatal error: GL/gl.h: No such file or directory
      compilation terminated.
      make: *** [rain.o] Error 1


      Would anyone happen to know why it can't find this file, when it can on my school computers? And what I'd need to do to download it or get it in the right spot?







      compiling opengl






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 15 '16 at 22:07









      Braiam

      52.7k20138225




      52.7k20138225










      asked Jun 11 '13 at 4:40









      SeldomSeldom

      333135




      333135






















          3 Answers
          3






          active

          oldest

          votes


















          76














          I'd guess you don't have whatever dev package(s) provide gl.h. apt-file is the command line tool to use.



          First, make sure it's up to date:



          apt-file update


          Now you can write a search to answer "what package provides the gl.h file?"



          apt-file search "gl.h"


          I don't have an ubuntu box just now to check, but I'd guess the result will be something like mesa-dev or opengl-dev.



          Once you know what package provides "gl.h", (let's pretend the result from apt-file is "libmesa-dev"), install it:



          apt-get install libmesa-dev


          More info on the apt family of commands: https://help.ubuntu.com/community/AptGet/Howto






          share|improve this answer


























          • Thanks for the help. I tried what you suggested and updated the original post with the output of the search.

            – Seldom
            Jun 11 '13 at 8:13











          • Decided to just play around with it and downloaded the mesa-common-dev package. Then I managed to navigate to the usr/include/GL folder and found that it was there. I moved just copied/pasted it into my project's folder and it seemed to work. But then my project was giving an error that it needed a "glu.h" folder, so I downloaded the libcgal-dev package, and did the same thing with the copy/paste. After putting that in the correct folder, and running the make command, the project compiles and will run. So thank you very much for the help. Now I just need to get the graphics to slow down. :)

            – Seldom
            Jun 11 '13 at 8:41











          • Glad you got the build to work! Your copy/paste is the quick and dirty, but properly, your includes might be wrong. I don't know much c++, but had a similar problem compiling some package from source. Solution, iirc, was like changing #include <gl.h> to #include<gl/gl.h>.

            – djeikyb
            Jun 11 '13 at 16:00






          • 19





            Oh, man thank you so much for teaching me to fish instead of just giving me the name of the package!

            – Brian Cain
            Aug 28 '13 at 0:22






          • 2





            Thanks for the info on apt-file. Regarding the required package for GL/gl.h, it is: mesa-common-dev (at least for Ubuntu 16.04)

            – ElazarR
            Aug 17 '16 at 13:52



















          30














          For GL/gl.h use:



          sudo apt install mesa-common-dev


          You may also find these helpful, for, say, GL/glu.h:



          sudo apt install libglu1-mesa-dev freeglut3-dev





          share|improve this answer































            1














            You can also build glproto (link), libdrm (link), and then mesa (link) from source. While many other packages may contain this header file, it's important to go to the source. This will reduce the memory footprint of your installations and ensure you have the latest and/or greatest version.






            share|improve this answer
























              Your Answer








              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "89"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














              draft saved

              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f306703%2fcompile-opengl-program-missing-gl-gl-h%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              3 Answers
              3






              active

              oldest

              votes








              3 Answers
              3






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              76














              I'd guess you don't have whatever dev package(s) provide gl.h. apt-file is the command line tool to use.



              First, make sure it's up to date:



              apt-file update


              Now you can write a search to answer "what package provides the gl.h file?"



              apt-file search "gl.h"


              I don't have an ubuntu box just now to check, but I'd guess the result will be something like mesa-dev or opengl-dev.



              Once you know what package provides "gl.h", (let's pretend the result from apt-file is "libmesa-dev"), install it:



              apt-get install libmesa-dev


              More info on the apt family of commands: https://help.ubuntu.com/community/AptGet/Howto






              share|improve this answer


























              • Thanks for the help. I tried what you suggested and updated the original post with the output of the search.

                – Seldom
                Jun 11 '13 at 8:13











              • Decided to just play around with it and downloaded the mesa-common-dev package. Then I managed to navigate to the usr/include/GL folder and found that it was there. I moved just copied/pasted it into my project's folder and it seemed to work. But then my project was giving an error that it needed a "glu.h" folder, so I downloaded the libcgal-dev package, and did the same thing with the copy/paste. After putting that in the correct folder, and running the make command, the project compiles and will run. So thank you very much for the help. Now I just need to get the graphics to slow down. :)

                – Seldom
                Jun 11 '13 at 8:41











              • Glad you got the build to work! Your copy/paste is the quick and dirty, but properly, your includes might be wrong. I don't know much c++, but had a similar problem compiling some package from source. Solution, iirc, was like changing #include <gl.h> to #include<gl/gl.h>.

                – djeikyb
                Jun 11 '13 at 16:00






              • 19





                Oh, man thank you so much for teaching me to fish instead of just giving me the name of the package!

                – Brian Cain
                Aug 28 '13 at 0:22






              • 2





                Thanks for the info on apt-file. Regarding the required package for GL/gl.h, it is: mesa-common-dev (at least for Ubuntu 16.04)

                – ElazarR
                Aug 17 '16 at 13:52
















              76














              I'd guess you don't have whatever dev package(s) provide gl.h. apt-file is the command line tool to use.



              First, make sure it's up to date:



              apt-file update


              Now you can write a search to answer "what package provides the gl.h file?"



              apt-file search "gl.h"


              I don't have an ubuntu box just now to check, but I'd guess the result will be something like mesa-dev or opengl-dev.



              Once you know what package provides "gl.h", (let's pretend the result from apt-file is "libmesa-dev"), install it:



              apt-get install libmesa-dev


              More info on the apt family of commands: https://help.ubuntu.com/community/AptGet/Howto






              share|improve this answer


























              • Thanks for the help. I tried what you suggested and updated the original post with the output of the search.

                – Seldom
                Jun 11 '13 at 8:13











              • Decided to just play around with it and downloaded the mesa-common-dev package. Then I managed to navigate to the usr/include/GL folder and found that it was there. I moved just copied/pasted it into my project's folder and it seemed to work. But then my project was giving an error that it needed a "glu.h" folder, so I downloaded the libcgal-dev package, and did the same thing with the copy/paste. After putting that in the correct folder, and running the make command, the project compiles and will run. So thank you very much for the help. Now I just need to get the graphics to slow down. :)

                – Seldom
                Jun 11 '13 at 8:41











              • Glad you got the build to work! Your copy/paste is the quick and dirty, but properly, your includes might be wrong. I don't know much c++, but had a similar problem compiling some package from source. Solution, iirc, was like changing #include <gl.h> to #include<gl/gl.h>.

                – djeikyb
                Jun 11 '13 at 16:00






              • 19





                Oh, man thank you so much for teaching me to fish instead of just giving me the name of the package!

                – Brian Cain
                Aug 28 '13 at 0:22






              • 2





                Thanks for the info on apt-file. Regarding the required package for GL/gl.h, it is: mesa-common-dev (at least for Ubuntu 16.04)

                – ElazarR
                Aug 17 '16 at 13:52














              76












              76








              76







              I'd guess you don't have whatever dev package(s) provide gl.h. apt-file is the command line tool to use.



              First, make sure it's up to date:



              apt-file update


              Now you can write a search to answer "what package provides the gl.h file?"



              apt-file search "gl.h"


              I don't have an ubuntu box just now to check, but I'd guess the result will be something like mesa-dev or opengl-dev.



              Once you know what package provides "gl.h", (let's pretend the result from apt-file is "libmesa-dev"), install it:



              apt-get install libmesa-dev


              More info on the apt family of commands: https://help.ubuntu.com/community/AptGet/Howto






              share|improve this answer















              I'd guess you don't have whatever dev package(s) provide gl.h. apt-file is the command line tool to use.



              First, make sure it's up to date:



              apt-file update


              Now you can write a search to answer "what package provides the gl.h file?"



              apt-file search "gl.h"


              I don't have an ubuntu box just now to check, but I'd guess the result will be something like mesa-dev or opengl-dev.



              Once you know what package provides "gl.h", (let's pretend the result from apt-file is "libmesa-dev"), install it:



              apt-get install libmesa-dev


              More info on the apt family of commands: https://help.ubuntu.com/community/AptGet/Howto







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Mar 29 at 21:05

























              answered Jun 11 '13 at 6:16









              djeikybdjeikyb

              21.8k84682




              21.8k84682













              • Thanks for the help. I tried what you suggested and updated the original post with the output of the search.

                – Seldom
                Jun 11 '13 at 8:13











              • Decided to just play around with it and downloaded the mesa-common-dev package. Then I managed to navigate to the usr/include/GL folder and found that it was there. I moved just copied/pasted it into my project's folder and it seemed to work. But then my project was giving an error that it needed a "glu.h" folder, so I downloaded the libcgal-dev package, and did the same thing with the copy/paste. After putting that in the correct folder, and running the make command, the project compiles and will run. So thank you very much for the help. Now I just need to get the graphics to slow down. :)

                – Seldom
                Jun 11 '13 at 8:41











              • Glad you got the build to work! Your copy/paste is the quick and dirty, but properly, your includes might be wrong. I don't know much c++, but had a similar problem compiling some package from source. Solution, iirc, was like changing #include <gl.h> to #include<gl/gl.h>.

                – djeikyb
                Jun 11 '13 at 16:00






              • 19





                Oh, man thank you so much for teaching me to fish instead of just giving me the name of the package!

                – Brian Cain
                Aug 28 '13 at 0:22






              • 2





                Thanks for the info on apt-file. Regarding the required package for GL/gl.h, it is: mesa-common-dev (at least for Ubuntu 16.04)

                – ElazarR
                Aug 17 '16 at 13:52



















              • Thanks for the help. I tried what you suggested and updated the original post with the output of the search.

                – Seldom
                Jun 11 '13 at 8:13











              • Decided to just play around with it and downloaded the mesa-common-dev package. Then I managed to navigate to the usr/include/GL folder and found that it was there. I moved just copied/pasted it into my project's folder and it seemed to work. But then my project was giving an error that it needed a "glu.h" folder, so I downloaded the libcgal-dev package, and did the same thing with the copy/paste. After putting that in the correct folder, and running the make command, the project compiles and will run. So thank you very much for the help. Now I just need to get the graphics to slow down. :)

                – Seldom
                Jun 11 '13 at 8:41











              • Glad you got the build to work! Your copy/paste is the quick and dirty, but properly, your includes might be wrong. I don't know much c++, but had a similar problem compiling some package from source. Solution, iirc, was like changing #include <gl.h> to #include<gl/gl.h>.

                – djeikyb
                Jun 11 '13 at 16:00






              • 19





                Oh, man thank you so much for teaching me to fish instead of just giving me the name of the package!

                – Brian Cain
                Aug 28 '13 at 0:22






              • 2





                Thanks for the info on apt-file. Regarding the required package for GL/gl.h, it is: mesa-common-dev (at least for Ubuntu 16.04)

                – ElazarR
                Aug 17 '16 at 13:52

















              Thanks for the help. I tried what you suggested and updated the original post with the output of the search.

              – Seldom
              Jun 11 '13 at 8:13





              Thanks for the help. I tried what you suggested and updated the original post with the output of the search.

              – Seldom
              Jun 11 '13 at 8:13













              Decided to just play around with it and downloaded the mesa-common-dev package. Then I managed to navigate to the usr/include/GL folder and found that it was there. I moved just copied/pasted it into my project's folder and it seemed to work. But then my project was giving an error that it needed a "glu.h" folder, so I downloaded the libcgal-dev package, and did the same thing with the copy/paste. After putting that in the correct folder, and running the make command, the project compiles and will run. So thank you very much for the help. Now I just need to get the graphics to slow down. :)

              – Seldom
              Jun 11 '13 at 8:41





              Decided to just play around with it and downloaded the mesa-common-dev package. Then I managed to navigate to the usr/include/GL folder and found that it was there. I moved just copied/pasted it into my project's folder and it seemed to work. But then my project was giving an error that it needed a "glu.h" folder, so I downloaded the libcgal-dev package, and did the same thing with the copy/paste. After putting that in the correct folder, and running the make command, the project compiles and will run. So thank you very much for the help. Now I just need to get the graphics to slow down. :)

              – Seldom
              Jun 11 '13 at 8:41













              Glad you got the build to work! Your copy/paste is the quick and dirty, but properly, your includes might be wrong. I don't know much c++, but had a similar problem compiling some package from source. Solution, iirc, was like changing #include <gl.h> to #include<gl/gl.h>.

              – djeikyb
              Jun 11 '13 at 16:00





              Glad you got the build to work! Your copy/paste is the quick and dirty, but properly, your includes might be wrong. I don't know much c++, but had a similar problem compiling some package from source. Solution, iirc, was like changing #include <gl.h> to #include<gl/gl.h>.

              – djeikyb
              Jun 11 '13 at 16:00




              19




              19





              Oh, man thank you so much for teaching me to fish instead of just giving me the name of the package!

              – Brian Cain
              Aug 28 '13 at 0:22





              Oh, man thank you so much for teaching me to fish instead of just giving me the name of the package!

              – Brian Cain
              Aug 28 '13 at 0:22




              2




              2





              Thanks for the info on apt-file. Regarding the required package for GL/gl.h, it is: mesa-common-dev (at least for Ubuntu 16.04)

              – ElazarR
              Aug 17 '16 at 13:52





              Thanks for the info on apt-file. Regarding the required package for GL/gl.h, it is: mesa-common-dev (at least for Ubuntu 16.04)

              – ElazarR
              Aug 17 '16 at 13:52













              30














              For GL/gl.h use:



              sudo apt install mesa-common-dev


              You may also find these helpful, for, say, GL/glu.h:



              sudo apt install libglu1-mesa-dev freeglut3-dev





              share|improve this answer




























                30














                For GL/gl.h use:



                sudo apt install mesa-common-dev


                You may also find these helpful, for, say, GL/glu.h:



                sudo apt install libglu1-mesa-dev freeglut3-dev





                share|improve this answer


























                  30












                  30








                  30







                  For GL/gl.h use:



                  sudo apt install mesa-common-dev


                  You may also find these helpful, for, say, GL/glu.h:



                  sudo apt install libglu1-mesa-dev freeglut3-dev





                  share|improve this answer













                  For GL/gl.h use:



                  sudo apt install mesa-common-dev


                  You may also find these helpful, for, say, GL/glu.h:



                  sudo apt install libglu1-mesa-dev freeglut3-dev






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Jan 1 '17 at 20:38









                  RichardRichard

                  71631225




                  71631225























                      1














                      You can also build glproto (link), libdrm (link), and then mesa (link) from source. While many other packages may contain this header file, it's important to go to the source. This will reduce the memory footprint of your installations and ensure you have the latest and/or greatest version.






                      share|improve this answer




























                        1














                        You can also build glproto (link), libdrm (link), and then mesa (link) from source. While many other packages may contain this header file, it's important to go to the source. This will reduce the memory footprint of your installations and ensure you have the latest and/or greatest version.






                        share|improve this answer


























                          1












                          1








                          1







                          You can also build glproto (link), libdrm (link), and then mesa (link) from source. While many other packages may contain this header file, it's important to go to the source. This will reduce the memory footprint of your installations and ensure you have the latest and/or greatest version.






                          share|improve this answer













                          You can also build glproto (link), libdrm (link), and then mesa (link) from source. While many other packages may contain this header file, it's important to go to the source. This will reduce the memory footprint of your installations and ensure you have the latest and/or greatest version.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Aug 3 '16 at 13:46









                          Adam EricksonAdam Erickson

                          1114




                          1114






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Ask Ubuntu!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f306703%2fcompile-opengl-program-missing-gl-gl-h%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              數位音樂下載

                              When can things happen in Etherscan, such as the picture below?

                              格利澤436b