g++ linker: /usr/lib/libGL.so.1: could not read symbols: Invalid operation

前端 未结 2 1923
傲寒
傲寒 2021-01-04 14:10

I\'m trying to build a very simple OpenGL-app under Ubuntu 10.04 (I have a 32 bit system).

When I\'m trying to compile the file, I get the error message:

<         


        
2条回答
  •  粉色の甜心
    2021-01-04 14:53

    compile with

    g++ main.cpp -o main.bin -lGL -lGLU -lglut
    

    or Try the following make file from OpenGL primer it is very compact. This one helped me to run my Hello world OpenGL. Thanks to OpenGL Primer

    CC = g++
    SRC = main.cpp imageloader.cpp
    LIBS = -lGL -lGLU -lglut
    EXEC = cube.bin
    
    all:
           $(CC) $(SRC) -o $(EXEC) $(LIBS)
    
    clean:
           rm -rf $(EXEC) *~
    

提交回复
热议问题