Wsl+VsCode配置open+eigen环境

安装wsl

在Microsoft store 下载 ubuntu18.4 LTS

Wsl+VsCode配置open+eigen环境_第1张图片

更换源

使用vscode编辑(推荐)

sudo chowm -R 用户名/etc/apt/sources.list
code /etc/apt/sources.list

将下面内容复制到sources.list中(也可以使用其他源)

#alicloud
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multivers

使用vim

/etc/apt/sources.list
将上面内容复制进去即可

更新

sudo apt update
sudo apt upgrade

安装Eigen

sudo apt install libeigen3-dev

安装cmake,gdb

sudo apt install cmake
sudo apt install gdb

安装opencv

可能会需要用到(安装)的依赖

sudo apt-get install build-essential libgtk2.0-dev libavcodec-dev libavformat-dev \
	libjpeg-dev libswscale-dev libtiff5-dev libgtk2.0-dev pkg-config

cmake

cmake -D CMAKE_BUILD_TYPE=RELEASE \
    -D CMAKE_INSTALL_PREFIX=/usr/local \
    -D OPENCV_GENERATE_PKGCONFIG=ON ..

成功安装后的截图

Wsl+VsCode配置open+eigen环境_第2张图片

make

执行完命令后可以去喝茶了

sudo make -j4
sudo make install

安装XLaunch(可以输出图形结果)

下载

在末尾添加

# vim /barchs
export DISPLAY=:0.0

Wsl+VsCode配置open+eigen环境_第3张图片

Wsl+VsCode配置open+eigen环境_第4张图片

配置了很久,都不能用g++和在vscode 成功的配置出运行环境,等以后成功了再来更新

你可能感兴趣的:(计算机图形学学习,wsl,opencv,vscode,eigen,games101)