Ubuntu查看c++版本
时间: 2023-06-20 14:09:13 浏览: 295
在 Ubuntu 上查看 C++ 版本,可以使用以下命令:
```
g++ --version
```
该命令会输出 g++ 的版本信息,包括 C++ 标准的版本号。例如:
```
g++ (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
```
在上面的输出中,“Ubuntu 7.5.0-3ubuntu1~18.04” 表示 g++ 的版本为 7.5.0,而且是在 Ubuntu 18.04 系统中安装的。
相关问题
ubuntu20.04安装opencv c++版本
以下是在Ubuntu 20.04上安装OpenCV C++版本的步骤:
1. 打开终端,更新apt-get:
```
sudo apt-get update
```
2. 安装OpenCV所需的依赖项:
```
sudo apt-get install build-essential cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
sudo apt-get install libopencv-dev
```
3. 检查OpenCV是否已成功安装:
```
pkg-config --modversion opencv
```
如果安装成功,将会显示OpenCV的版本号。
4. 创建一个新的C++项目,并在CMakeLists.txt文件中添加以下内容:
```
cmake_minimum_required(VERSION 2.8)
project(my_project)
find_package(OpenCV REQUIRED)
add_executable(my_project main.cpp)
target_link_libraries(my_project ${OpenCV_LIBS})
```
5. 编写C++代码,并将其保存为main.cpp。
6. 编译并运行项目:
```
cmake .
make
./my_project
```
现在,您应该已经成功安装了OpenCV C++版本,并且可以使用它来开发计算机视觉应用程序。
Ubuntu20.04查看vtk版本
要查看Ubuntu 20.04上安装的vtk的版本,可以使用以下命令:
```
dpkg -s libvtk-common1d
```
在输出中,您应该会看到vtk的版本号。例如:
```
Package: libvtk-common1d
Status: install ok installed
Priority: optional
Section: libs
Installed-Size: 1274
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Architecture: amd64
Source: vtk6 (6.3.0+dfsg2-2build1)
Version: 6.3.0+dfsg2-2build1
Depends: libc6 (>= 2.14), libgcc1 (>= 1:3.0), libstdc++6 (>= 5.2), zlib1g (>= 1:1.1.4), libexpat1 (>= 2.0.1)
Description: VTK - Common data for VTK
VTK is an open-source, freely available software system for 3D computer graphics, image processing, and visualization. It consists of a C++ class library and several interpreted interface layers including Tcl/Tk, Java, and Python. VTK is part of Kitware's collection of supported platforms for software development.
Homepage: http://www.vtk.org/
```
在这个例子中,vtk的版本号是6.3.0+dfsg2-2build1。