Saturday 6 July 2019

Compile error when linking against two libraries in C++

compile command:



 g++  ast01.cpp -o ast01 -lglu -lglut


error:




/usr/bin/ld: error: cannot find -lglu
/tmp/ccjQZPPr.o:ast01.cpp:function displaySpiral(): error: undefined reference to 'glClear'
/tmp/ccjQZPPr.o:ast01.cpp:function displaySpiral(): error: undefined reference to 'glBegin'
/tmp/ccjQZPPr.o:ast01.cpp:function displaySpiral(): error: undefined reference to 'glColor3ub'
/tmp/ccjQZPPr.o:ast01.cpp:function displaySpiral(): error: undefined reference to 'glEnd'
/tmp/ccjQZPPr.o:ast01.cpp:function displaySpiral(): error: undefined reference to 'glFlush'
/tmp/ccjQZPPr.o:ast01.cpp:function openGLinit(int, char**): error: undefined reference to 'glClearColor'
/tmp/ccjQZPPr.o:ast01.cpp:function openGLinit(int, char**): error: undefined reference to 'glMatrixMode'
/tmp/ccjQZPPr.o:ast01.cpp:function openGLinit(int, char**): error: undefined reference to 'glLoadIdentity'
/tmp/ccjQZPPr.o:ast01.cpp:function openGLinit(int, char**): error: undefined reference to 'gluOrtho2D'

/tmp/ccjQZPPr.o:ast01.cpp:function openGLinit(int, char**): error: undefined reference to 'glMatrixMode'
collect2: ld returned 1 exit status

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...