**
安装步骤
**:
1.安装OpenGL,安装命令
sudo apt-get install build-essential
sudo apt-get install libgl1-mesa-dev
sudo apt-get install libglu1-mesa-dev
sudo apt-get install libglut-dev
sudo apt-get install freeglut3-dev
安装完opengl以后可以用以下代码测试:
#include <GL/glut.h>
void init(void)
{
glClearColor(0.0, 0.0, 0.0, 0.0);
glMatrixMode(GL_PROJECTION);
glOrtho(-5, 5, -5, 5, 5, 15);
glMatrixMode(GL_MODELVIEW);
gluLookAt(0, 0, 10, 0, 0, 0, 0, 1, 0);
return;
}
void display(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1.0, 0, 0);
glutWireTeapot(3);
glFlush();
return;
}
int main(int argc, char *argv[])
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGB | GLUT_SINGLE);
glutInitWindowPosition(0, 0);
glutInitWindowSize(300, 300);
glutCreateWindow("OpenGL 3D View");
init();
glutDisplayFunc(display);
glutMainLoop();
return 0;
}
完成后编译链接执行:
gcc -o opengl opengl.c -lGL -lGLU -lglut
$./opengl
参考链接:https://blog.csdn.net/l297969586/article/details/53534807
**
2.安装Pangolin
**
安装命令
git clone https://github.com/stevenlovegrove/Pangolin.git
cd Pangolin
mkdir build
cd build
cmake …
make
sudo make install
参考链接:https://blog.csdn.net/renhaofan/article/details/80991810
3.遇到的问题
make无法完成,查找原因报错 未找到 glew
解决办法
重新安装 libglew-dev,使用命令
sudo apt-get install libglew-dev
sudo apt-get install cmake
sudo apt-get install libboost-dev libboost-thread-dev libboost-filesystem-dev
完成后在再使用以下命令重新安装:
cmake:
make
sudo make install
安装成功
参考链接:https://blog.csdn.net/u012986684/article/details/52860849