Results 1 to 4 of 4

Thread: How to get started with OpenGL on Linux with C++?

  1. #1
    Join Date
    Apr 2009
    Beans
    2

    How to get started with OpenGL on Linux with C++?

    Hi,
    I have tried running a 1st OpenGL program and receive the error: Permission denied.


    1. To setup OpenGL with Linux Mint Mate I:
    Linux > Terminal > (go to folder to store new file. E.g.: /media/All files) > touch BasicGLUT.cpp > nano BasicGLUT.cpp > (enter code and save file) > g++ BasicGLUT.cpp -o BasicGlut -lglut -lGL > ./BasicGlut > Permission denied.
    I also tried g++ BasicGLUT.cpp -lGL -lGLU -lglut -lm -o BasicGlut > Permission denied.




    2. To setup OpenGL with Linux Mint Mate with NetBeans 7.3 with C++ I:
    Install OpenGL to Linux: url
    Linux > Terminal > sudo apt-get update
    Linux > Terminal > sudo apt-get install libgl1-mesa-dev
    Linux > Terminal > sudo apt-get update
    Linux > Terminal > sudo apt-get install build-essential
    Linux > Terminal > sudo apt-get install libglew1.5-dev freeglut3-dev libglm-dev
    glxinfo | grep OpenGL


    Install NetBeans: url
    Download NetBeans: url
    Download > Terminal > go to Downloads folder with the downloaded Netbeans file > chmod +x netbeans-7.3-linux.sh > ./netbeans-7.3-linux.sh > netbeans.


    NetBeans has problems like:
    Mouse click doesn't hold submenu's from ribbon menu like File etc...
    Compile gives errors:
    make[2]: *** [dist/Debug/GNU-Linux-x86/text_book_page_46] Error 1
    make[2]: Leaving directory `/media/All files/Text book page 46'
    make[1]: *** [.build-conf] Error 2
    make[1]: Leaving directory `/media/All files/Text book page 46'
    make: *** [.build-impl] Error 2
    BUILD FAILED (exit value 2, total time: 375ms)




    Here is my code I'm using:
    // #include <GL/GLUT.h> // Might need to change this for Linux, as this example is for a Mac.
    #include <GL/gl.h>
    #include <GL/glut.h>


    void render(void);


    int main(int argc, char** argv)
    {
    glutInit(&argc, argv);
    glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA);
    glutInitWindowPosition(100, 100);
    glutInitWindowSize(640, 480);
    glutCreateWindow("Simple GLUT application");


    glutDisplayFunc(render);


    glutMainLoop(); // Says process has finished and can start rendering.
    }


    void render(void)
    {


    }
    Last edited by eiger3970; March 2nd, 2013 at 08:38 AM.

  2. #2
    Join Date
    May 2011
    Beans
    226
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: How to get started with OpenGL on Linux with C++?

    Do a:
    Code:
    ls -l BasicGLUT.cpp
    and
    Code:
    ls -l BasicGlut
    inside the directory containing BasicGLUT.cpp and post the result. It sounds like a permissions issue.

  3. #3
    Join Date
    Apr 2009
    Beans
    2

    Re: How to get started with OpenGL on Linux with C++?

    Quote Originally Posted by Mr. Shannon View Post
    Do a:
    Code:
    ls -l BasicGLUT.cpp
    and
    Code:
    ls -l BasicGlut
    inside the directory containing BasicGLUT.cpp and post the result. It sounds like a permissions issue.
    Thanks for the reply.
    ls -l BasicGLUT.cpp, outputs the result:
    -rw------- 1 ken ken 510 Mar 2 16:41 BasicGLUT.cpp

    ls -l BasicGlut, outputs the result:
    -rw------- 1 ken ken 8709 Mar 3 12:24 BasicGlut

  4. #4
    Join Date
    Sep 2012
    Beans
    10

    Re: How to get started with OpenGL on Linux with C++?

    try to give exec permission to the output file:
    Code:
    chmod +x BasicGlut
    and then, again
    Code:
    ./BasicGlut
    Btw it's very strange, because the output files of g++ should have execution permissions by default.

    Bye

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •