LINUX.ORG.RU

Ошибки GLAD в opengl

 ,


0

1

Все привет. Решил потыкать Opengl, поставил себе glfw, также хотел себе поставить GLAD отсюда (кидал в usr/share/include, компилятор gcc), и получаю такие ошибки:

Почему и как решить? Неправильно поставил?

-------------- Build: Debug in tryingOpnegl (compiler: GNU GCC Compiler)---------------

gcc  -o bin/Debug/tryingOpnegl obj/Debug/main.o   -lGL -lX11
/usr/bin/ld: obj/Debug/main.o: warning: relocation against `glad_glRotatef' in read-only section `.text'
/usr/bin/ld: obj/Debug/main.o: in function `redraw':
/home/pups/Development/opengl/tryingOpnegl/main.c:38: undefined reference to `glad_glCallList'
/usr/bin/ld: /home/pups/Development/opengl/tryingOpnegl/main.c:43: undefined reference to `glad_glNewList'
/usr/bin/ld: /home/pups/Development/opengl/tryingOpnegl/main.c:44: undefined reference to `glad_glClear'
/usr/bin/ld: /home/pups/Development/opengl/tryingOpnegl/main.c:47: undefined reference to `glad_glBegin'
/usr/bin/ld: /home/pups/Development/opengl/tryingOpnegl/main.c:48: undefined reference to `glad_glColor3f'
/usr/bin/ld: /home/pups/Development/opengl/tryingOpnegl/main.c:49: undefined reference to `glad_glVertex3f'
/usr/bin/ld: /home/pups/Development/opengl/tryingOpnegl/main.c:50: undefined reference to `glad_glVertex3f'
/usr/bin/ld: /home/pups/Development/opengl/tryingOpnegl/main.c:51: undefined reference to `glad_glVertex3f'
/usr/bin/ld: /home/pups/Development/opengl/tryingOpnegl/main.c:52: undefined reference to `glad_glVertex3f'
/usr/bin/ld: /home/pups/Development/opengl/tryingOpnegl/main.c:55: undefined reference to `glad_glColor3f'
/usr/bin/ld: /home/pups/Development/opengl/tryingOpnegl/main.c:56: undefined reference to `glad_glVertex3f'
/usr/bin/ld: /home/pups/Development/opengl/tryingOpnegl/main.c:57: undefined reference to `glad_glVertex3f'
/usr/bin/ld: /home/pups/Development/opengl/tryingOpnegl/main.c:58: undefined reference to `glad_glVertex3f'
/usr/bin/ld: /home/pups/Development/opengl/tryingOpnegl/main.c:59: undefined reference to `glad_glVertex3f'
/usr/bin/ld: /home/pups/Development/opengl/tryingOpnegl/main.c:62: undefined reference to `glad_glColor3f'
/usr/bin/ld: /home/pups/Development/opengl/tryingOpnegl/main.c:63: undefined reference to `glad_glVertex3f'
/usr/bin/ld: /home/pups/Development/opengl/tryingOpnegl/main.c:64: undefined reference to `glad_glVertex3f'
/usr/bin/ld: /home/pups/Development/opengl/tryingOpnegl/main.c:65: undefined reference to `glad_glVertex3f'
/usr/bin/ld: /home/pups/Development/opengl/tryingOpnegl/main.c:66: undefined reference to `glad_glVertex3f'
/usr/bin/ld: /home/pups/Development/opengl/tryingOpnegl/main.c:69: undefined reference to `glad_glColor3f'
/usr/bin/ld: /home/pups/Development/opengl/tryingOpnegl/main.c:70: undefined reference to `glad_glVertex3f'
/usr/bin/ld: /home/pups/Development/opengl/tryingOpnegl/main.c:71: undefined reference to `glad_glVertex3f'
/usr/bin/ld: /home/pups/Development/opengl/tryingOpnegl/main.c:72: undefined reference to `glad_glVertex3f'
/usr/bin/ld: /home/pups/Development/opengl/tryingOpnegl/main.c:73: undefined reference to `glad_glVertex3f'
/usr/bin/ld: /home/pups/Development/opengl/tryingOpnegl/main.c:74: undefined reference to `glad_glEnd'
/usr/bin/ld: /home/pups/Development/opengl/tryingOpnegl/main.c:75: undefined reference to `glad_glEndList'
/usr/bin/ld: /home/pups/Development/opengl/tryingOpnegl/main.c:81: undefined reference to `glad_glFlush'
/usr/bin/ld: obj/Debug/main.o: in function `main':
/home/pups/Development/opengl/tryingOpnegl/main.c:150: undefined reference to `glad_glEnable'
/usr/bin/ld: /home/pups/Development/opengl/tryingOpnegl/main.c:151: undefined reference to `glad_glDepthFunc'
/usr/bin/ld: /home/pups/Development/opengl/tryingOpnegl/main.c:152: undefined reference to `glad_glClearDepth'
/usr/bin/ld: /home/pups/Development/opengl/tryingOpnegl/main.c:155: undefined reference to `glad_glClearColor'
/usr/bin/ld: /home/pups/Development/opengl/tryingOpnegl/main.c:158: undefined reference to `glad_glMatrixMode'
/usr/bin/ld: /home/pups/Development/opengl/tryingOpnegl/main.c:159: undefined reference to `glad_glLoadIdentity'
/usr/bin/ld: /home/pups/Development/opengl/tryingOpnegl/main.c:160: undefined reference to `glad_glFrustum'
/usr/bin/ld: /home/pups/Development/opengl/tryingOpnegl/main.c:163: undefined reference to `glad_glViewport'
/usr/bin/ld: /home/pups/Development/opengl/tryingOpnegl/main.c:205: undefined reference to `glad_glViewport'
/usr/bin/ld: /home/pups/Development/opengl/tryingOpnegl/main.c:216: undefined reference to `glad_glMatrixMode'
/usr/bin/ld: /home/pups/Development/opengl/tryingOpnegl/main.c:219: undefined reference to `glad_glLoadIdentity'
/usr/bin/ld: /home/pups/Development/opengl/tryingOpnegl/main.c:222: undefined reference to `glad_glTranslatef'
/usr/bin/ld: /home/pups/Development/opengl/tryingOpnegl/main.c:225: undefined reference to `glad_glRotatef'
/usr/bin/ld: /home/pups/Development/opengl/tryingOpnegl/main.c:226: undefined reference to `glad_glRotatef'
/usr/bin/ld: /home/pups/Development/opengl/tryingOpnegl/main.c:227: undefined reference to `glad_glRotatef'
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE
collect2: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 0 second(s))
43 error(s), 2 warning(s) (0 minute(s), 0 second(s))

Попробуй путь к GLaD через -I указать

IIIypuk ★★★★
()

Что-то мне подсказывает, что тебе GLAD .so собрать нужно.

Установи через PIP, как указано в руководтстве на GitHub

IIIypuk ★★★★
()

undefined reference
это вроде значит что у тебя линковщику не указана библиотека

gcc -o bin/Debug/tryingOpnegl obj/Debug/main.o -lGL -lX11 -lGlad

или что-то типа того

Bad_ptr ★★★★★
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.