Ubuntu 16.04 安装OpenGL & 运行第一个demo

在14.04上装了一晚上,失败,故切换到16.04上

首先,更改源到阿里云服务器
sudo nano /etc/apt/sources.list

# deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main restricted
deb-src http://archive.ubuntu.com/ubuntu xenial main restricted #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties
deb http://archive.canonical.com/ubuntu xenial partner
deb-src http://archive.canonical.com/ubuntu xenial partner
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse

使用synaptic安装以下的包
sudo apt-get install synaptic

freeglut3-dev
cmake
libx11-dev
binutils-gold
libxi-dev
libxrandr-dev
libxinerama-dev
libxcursor-dev

安装完之后,下载OpenGL
https://codeload.github.com/opengl-tutorials/ogl/zip/OpenGL-tutorial_0015_33
将其解压

mkdir build
cd build
cmake ..
make all
cd ..
cd playground
./playground

如果一个黑色窗口显示出来,那么恭喜你,All done!

你可能感兴趣的:(Ubuntu 16.04 安装OpenGL & 运行第一个demo)