# How to Build libplctag The build system uses CMake to bootstrap a local build. On Linux. On Windows, this makes a Visual Studio project. CMake is also used to create a build on macOS. Note that as of version 2.0.22, pre-built binaries are included in the GitHub releases. # Instructions for Linux ## Install the compilers ### Debian/Ubuntu #### Install Build Essentials, CMake and Git ```text $> sudo apt-get install build-essential cmake git ``` Use your distro-specific instructions to install Clang if you want to use that compiler. ### RHEL/CentOS These instructions probably work with few modifications for Red Hat and Oracle Linux. Please file a GitHub ticket if they need changes for SUSE and other RPM-based distributions. #### Install Compilers, CMake and Git You need to become root or, if your Linux distribution supports it, run these commands with `sudo`. ```text $> yum install gcc gcc-c++ cmake git ```翻译
时间: 2024-02-14 17:33:26 浏览: 38
# 如何构建libplctag
构建系统使用CMake来启动本地构建。在Linux上,它使用CMake创建一个Visual Studio项目。在macOS上也使用CMake来创建构建。
请注意,从版本2.0.22开始,预编译的二进制文件已包含在GitHub发布中。
# Linux的说明
## 安装编译器
### Debian/Ubuntu
#### 安装构建必需品、CMake和Git
```text
$> sudo apt-get install build-essential cmake git
```
如果想使用Clang编译器,请按照特定于您发行版的说明进行安装。
### RHEL/CentOS
这些说明可能需要进行一些修改才能在Red Hat和Oracle Linux上正常工作。如果需要适应SUSE和其他基于RPM的发行版,请提交GitHub工单。
#### 安装编译器、CMake和Git
您需要以root身份登录,或者如果您的Linux发行版支持,则使用`sudo`运行这些命令。
```text
$> yum install gcc gcc-c++ cmake git
```
相关问题
1>CUSTOMBUILD : CMake error : The following variables are used in this project, but they are set to NOTFOUND.
这个错误提示通常出现在使用 CMake 构建项目时,需要的某些依赖库没有找到。你可以通过以下方法来解决这个问题:
1. 确认依赖库是否已经安装。可以使用系统包管理器来安装依赖库,或者从官网下载依赖库源代码编译安装。
2. 设置 CMake 的相关变量。你可以在 CMakeLists.txt 文件中设置相关变量,例如:
```
set(OpenCV_DIR /path/to/opencv)
```
其中 /path/to/opencv 是你的 OpenCV 安装路径。
3. 检查 CMakeLists.txt 中的依赖库设置是否正确。你可以在 CMakeLists.txt 文件中查找相关的依赖库设置,并确认它们是否正确。
如果你仍然无法解决这个问题,可以提供更多的错误信息或者 CMakeLists.txt 文件内容,我可以提供更具体的建议。
CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles".
这个错误通常出现在使用CMake时,CMake无法找到与"MinGW Makefiles"相应的构建程序。
要解决此问题,您需要安装MinGW并将其添加到系统路径中。然后,您需要打开CMake GUI并将生成器设置为"MinGW Makefiles",然后点击"Configure"并"Generate"按钮重新生成项目。
如果您已经安装了MinGW但仍然遇到此错误,请确保MinGW的bin目录已经添加到您的系统路径中。您可以通过在命令提示符下输入"mingw32-make -v"来检查是否正确安装并配置了MinGW。