configure: error: GDB must be configured and built in a directory separate from its sources. To do so, create a dedicated directory for your GDB build and invoke the configure script from that directory:举例
时间: 2023-12-14 07:35:57 浏览: 234
假设你的 GDB 源代码目录为 `/home/user/gdb`,你可以按照以下步骤来创建一个独立的目录来编译和构建 GDB:
1. 创建一个新的目录,例如 `/home/user/gdb-build`,用于构建 GDB。
2. 进入 `/home/user/gdb-build` 目录。
3. 运行 GDB 源代码目录中的 configure 脚本,并将其指向 `/home/user/gdb` 目录:
```
/home/user/gdb/configure
```
4. 运行 make 命令来编译 GDB:
```
make
```
5. 安装 GDB 到默认位置:
```
make install
```
注意,如果你想将 GDB 安装到一个非默认位置,可以在运行 configure 时使用 `--prefix` 选项来指定安装目录。例如:
```
/home/user/gdb/configure --prefix=/opt/gdb
```
这将会将 GDB 安装到 `/opt/gdb` 目录中。
相关问题
configure: error: GDB must be configured and built in a directory separate from its sources. To do so, create a dedicated directory for your GDB build and invoke the configure script from that directory:
这个错误提示意味着你不能在 GDB 的源代码目录中执行 configure 脚本,而是需要在一个专门的目录中进行构建。为了解决这个问题,你需要按照以下步骤操作:
1. 创建一个新的目录来进行 GDB 的构建,例如 "build_gdb"。
2. 进入这个新的目录,并执行 GDB 的 configure 脚本,例如:
```
$ mkdir build_gdb
$ cd build_gdb
$ ../gdb/source/path/configure [options]
```
请注意,`../gdb/source/path` 是 GDB 源代码目录的路径,`[options]` 是你需要传递给 configure 脚本的选项。
3. 如果 configure 脚本成功执行,你可以继续使用 make 命令来构建和安装 GDB:
```
$ make
$ make install
```
这样就可以解决 "GDB must be configured and built in a directory separate from its sources" 的错误提示了。
阅读全文
相关推荐













