Announcement

Collapse
No announcement yet.

cannot find -lGL

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    cannot find -lGL

    Not sure where to ask, but I hope someone here can help me.

    I'm trying to compile some OpenGL examples and get the same error, nomater what I try:
    cannot find -lGL

    It looks like /etc/ld.so.conf points to /etc/ld.so.conf.d/*.conf and in there I have:
    /usr/lib/fglrx
    /usr/lib32/fglrx

    I have several libGL.x and no idea wich one I'm using:
    /usr/lib32/fglrx/libGL.so.1
    /usr/lib32/fglrx/libGL.so.1.2
    /usr/lib/fglrx/libGL.so.1
    /usr/lib/fglrx/libGL.so
    /usr/lib/fglrx/libGL.so.1.2

    btw. I'm running Kubuntu 13.10 with fglrx-updates

    #2
    you will need some opengl -dev packages installed to compile whatever it is you are attempting to build.

    Packages will be similarly named to these:
    freeglut3
    freeglut3-dev
    libglew1.8
    libglew-dev
    libglu1-mesa
    libglu1-mesa-dev
    libgl1-mesa-glx
    libgl1-mesa-dev

    Comment


      #3
      I have installed:

      freeglut3
      freeglut3-dev
      libglew1.8
      libglew-dev
      libglu1-mesa
      libglu1-mesa-dev
      libgl1-mesa-glx
      libgl1-mesa-dev
      and a ton of other -dev packages related to OpenGL

      If I run:
      ldconfig -v | grep 'libGL'
      I get:
      /sbin/ldconfig.real: Can't stat /lib/i686-linux-gnu: No such file or directory
      /sbin/ldconfig.real: Can't stat /usr/lib/i686-linux-gnu: No such file or directory
      /sbin/ldconfig.real: Path `/lib/x86_64-linux-gnu' given more than once
      /sbin/ldconfig.real: Path `/usr/lib/x86_64-linux-gnu' given more than once
      libGLU.so.1 -> libGLU.so.1.3.1
      libGLEW.so.1.8 -> libGLEW.so.1.8.0
      libGLEWmx.so.1.8 -> libGLEWmx.so.1.8.0
      /sbin/ldconfig.real: Cannot stat /usr/lib/libfglrx_dm.so: No such file or directory
      libGLU.so.1 -> libGLU.so.1.3.1
      libGLESv2.so.2 -> libGLESv2.so.2.0.0
      libGL.so.1 -> libGL.so.1.2
      libGL.so.1 -> libGL.so.1.2
      libGLC.so.0 -> libGLC.so.0.0.7
      /sbin/ldconfig.real: Can't create temporary cache file /etc/ld.so.cache~: Permission denied

      Not sure what to make of this thou...
      Last edited by miss_b_have; Nov 08, 2013, 11:47 PM.

      Comment


        #4
        I dunno.
        Been so very long since I have compiled anything so I am quite rusty.
        Perhaps a link to the sources you are attempting to compile, and the steps you are using might help if someone doesn't chime in.

        Comment


          #5
          try this command
          Code:
          ld --verbose | grep SEARCH
          You should get something like:
          Code:
          SEARCH_DIR("/usr/x86_64-linux-gnu/lib64"); SEARCH_DIR("=/usr/local/lib/x86_64-linux-gnu"); SEARCH_DIR("=/usr/local/lib64"); SEARCH_DIR("=/lib/x86_64-linux-gnu"); SEARCH_DIR("=/lib64"); SEARCH_DIR("=/usr/lib/x86_64-linux-gnu"); SEARCH_DIR("=/usr/lib64"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
          See if the directories you expect are there.

          Your approach of adding the paths to the linker seems out of the ordinary. If everything is installed from the repos you shouldn't need to add the extra paths. I am tending to agree with claydoh that you are missing some -dev package. More details on what and how your are building would help.
          FKA: tanderson

          Comment


            #6
            If I run:
            Code:
            ld --verbose | grep SEARCH
            I get:
            Code:
            SEARCH_DIR("/usr/x86_64-linux-gnu/lib64"); SEARCH_DIR("=/usr/local/lib/x86_64-linux-gnu"); SEARCH_DIR("=/usr/local/lib64"); SEARCH_DIR("=/lib/x86_64-linux-gnu"); SEARCH_DIR("=/lib64"); SEARCH_DIR("=/usr/lib/x86_64-linux-gnu"); SEARCH_DIR("=/usr/lib64"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
            I haven't added any paths to the linker myself.

            The project I'm trying to compile is from the OpenGL wiki:
            Code:
            /* Using the standard output for fprintf */
            #include <stdio.h>
            #include <stdlib.h>
            /* Use glew.h instead of gl.h to get all the GL prototypes declared */
            #include <GL/glew.h>
            /* Using the GLUT library for the base windowing setup */
            #include <GL/glut.h>
            /* ADD GLOBAL VARIABLES HERE LATER */
             
            int init_resources(void)
            {
              /* FILLED IN LATER */
              return 1;
            }
             
            void onDisplay()
            {
              /* FILLED IN LATER */
            }
             
            void free_resources()
            {
              /* FILLED IN LATER */
            }
             
            int main(int argc, char* argv[])
            {
              /* Glut-related initialising functions */
              glutInit(&argc, argv);
              glutInitDisplayMode(GLUT_RGBA|GLUT_DOUBLE|GLUT_DEPTH);
              glutInitWindowSize(640, 480);
              glutCreateWindow("My First Triangle");
             
              /* Extension wrangler initialising */
              GLenum glew_status = glewInit();
              if (glew_status != GLEW_OK)
              {
                fprintf(stderr, "Error: %s\n", glewGetErrorString(glew_status));
                return EXIT_FAILURE;
              }
             
              /* When all init functions run without errors,
              the program can initialise the resources */
              if (1 == init_resources())
              {
                /* We can display it if everything goes OK */
                glutDisplayFunc(onDisplay);
                glutMainLoop();
              }
             
              /* If the program exits in the usual way,
              free resources and exit with a success */
              free_resources();
              return EXIT_SUCCESS;
            }
            And the Makefile looks like this:
            Code:
            CC=g++
            LDLIBS=-lglut -lGLEW -lGL
            all: triangle
            clean:
            	rm -f *.o triangle
            .PHONY: all clean
            The whole example is available here:
            http://en.wikibooks.org/wiki/OpenGL_...L_Introduction

            Comment


              #7
              I just purged fglrx-updates and fglrx-amdccle-updates, and then I installed the latest beta from ATI

              Now everything seams to work...

              Comment


                #8
                Originally posted by miss_b_have View Post
                I haven't added any paths to the linker myself.
                Sorry. You said you were getting an error no matter what you tried, then listed the contents of your linker config files. This game me the impression you were manually adding paths.

                Glad to here you got it working.
                FKA: tanderson

                Comment

                Working...
                X