mingw-w64-build: command not found
时间: 2023-08-02 20:09:14 浏览: 60
如果你在终端中输入`mingw-w64-build --help`时出现`command not found`的错误,可能是因为你没有安装`mingw-w64-build`工具。你需要先安装`mingw-w64-build`工具,然后才能使用它来构建MinGW-w64工具链。
你可以通过以下方法安装`mingw-w64-build`工具:
1. 在Linux或MacOS上,你可以使用包管理器安装`mingw-w64-build`,例如:
- 在Ubuntu或Debian中,你可以使用以下命令安装:
```
sudo apt-get install mingw-w64-build
```
- 在Fedora中,你可以使用以下命令安装:
```
sudo dnf install mingw-w64-build
```
- 在MacOS中,你可以使用Homebrew安装:
```
brew install mingw-w64-build
```
2. 在Windows上,你可以从`mingw-w64-build`的GitHub仓库下载二进制文件,并将其添加到系统PATH环境变量中。
安装完成后,你应该能够在终端中运行`mingw-w64-build`命令。
相关问题
报错mingw-w64-build: command not found
The error "mingw-w64-build: command not found" typically indicates that the mingw-w64-build command is not installed on your system or it is not in the PATH environment variable.
To fix this issue, you can try the following steps:
1. Install mingw-w64-build: If mingw-w64-build is not installed on your system, you can install it using a package manager such as apt-get or yum. For example, on Ubuntu, you can use the following command to install it:
```
sudo apt-get install mingw-w64-tools
```
2. Add mingw-w64-build to PATH: If mingw-w64-build is installed, but the command is still not recognized, you may need to add the directory containing the mingw-w64-build executable to your PATH environment variable. You can do this by adding the following line to your shell profile file (e.g., ~/.bashrc, ~/.zshrc):
```
export PATH=$PATH:/path/to/mingw-w64-build
```
Make sure to replace "/path/to/mingw-w64-build" with the actual path to the directory containing the mingw-w64-build executable.
After following these steps, try running the mingw-w64-build command again to see if the issue has been resolved.
pacman -S mingw-w64-x86_64-glibc mingw-w64-x86_64-glibc-devel error: target not found: mingw-w64-x86_64-glibc error: target not found: mingw-w64-x86_64-glibc-devel
如果在执行 `pacman -S mingw-w64-x86_64-glibc mingw-w64-x86_64-glibc-devel` 命令时出现 `error: target not found` 错误,可能是因为你的 MSYS2 没有正确更新或者没有添加正确的软件源。你可以尝试执行以下步骤来解决该问题:
1. 打开 MSYS2 终端,执行以下命令更新系统:
```
pacman -Syu
```
2. 然后执行以下命令安装基本开发工具:
```
pacman -S base-devel
```
3. 然后执行以下命令添加 mingw-w64 软件源:
```
pacman -S mingw-w64-x86_64-toolchain
```
4. 然后再执行以下命令安装 glibc 和 glibc 的开发包:
```
pacman -S mingw-w64-x86_64-glibc mingw-w64-x86_64-glibc-devel
```
如果你需要安装 32 位版本的 glibc,可以将命令中的 `x86_64` 替换为 `i686`。
5. 安装完成后,可以通过以下命令查看 glibc 的版本号:
```
pacman -Qi mingw-w64-x86_64-glibc
```
输出结果中的 Version 就是安装的 glibc 的版本号。
安装完成后,你可以在编译时指定 glibc 的路径,例如:
```
./configure --disable-shared --enable-static --with-glibc=/mingw64/include
```
其中,`/mingw64/include` 是 glibc 头文件所在的路径,你需要根据实际情况进行修改。