mpicc -o ../../bin/lsqfit main.o lsqfit_ls.o block_init.o line.o -L../../lib -ldblock -ldutil /home/ubuntu/software/tcl/tcl8.5.11/lib/libtcl8.5.so -lm -lc /usr/bin/ld: main.o: in function `main': main.c:(.text+0x239): undefined reference to `blk_open_file' /usr/bin/ld: main.c:(.text+0x499): undefined reference to `blk_open_file' /usr/bin/ld: main.c:(.text+0x5e3): undefined reference to `blk_open_file' /usr/bin/ld: main.c:(.text+0x8f9): undefined reference to `blk_open_file' /usr/bin/ld: ../../lib/libdblock.a(skip.o): in function `blk__skip': skip.c:(.text+0xed): undefined reference to `blk__getlines' /usr/bin/ld: skip.c:(.text+0x126): undefined reference to `blk__getlines' /usr/bin/ld: ../../lib/libdblock.a(read.o): in function `blk_init_read': read.c:(.text+0x15): undefined reference to `blk__getenv' /usr/bin/ld: ../../lib/libdblock.a(read.o): in function `blk_read_blk': read.c:(.text+0x6a): undefined reference to `blk__getenv' /usr/bin/ld: ../../lib/libdblock.a(read.o): in function `blk_read_data': read.c:(.text+0xad): undefined reference to `blk__getenv' /usr/bin/ld: ../../lib/libdblock.a(read.o): in function `blk__read_data': read.c:(.text+0x119): undefined reference to `blk__getlines' /usr/bin/ld: read.c:(.text+0x1b2): undefined reference to `blk__getlines' /usr/bin/ld: read.c:(.text+0x1e5): undefined reference to `blk__getlines' /usr/bin/ld: ../../lib/libdblock.a(read.o): in function `blk_read_check': read.c:(.text+0x398): undefined reference to `blk__getenv' /usr/bin/ld: ../../lib/libdblock.a(read.o): in function `blk_read_blk_check': read.c:(.text+0x3d6): undefined reference to `blk__getenv' /usr/bin/ld: ../../lib/libdblock.a(read.o): in function `blk__read_check': read.c:(.text+0x49b): undefined reference to `blk__getlines' /usr/bin/ld: read.c:(.text+0x788): undefined reference to `blk__getlines' /usr/bin/ld: ../../lib/libdblock.a(read.o): in function `blk_print_env': read.c:(.text+0xbdf): undefined reference to `blk__getenv' /usr/bin/ld: ../../lib/libdblock.a(variable
时间: 2023-10-10 11:06:44 浏览: 83
这个错误提示是链接器(ld)在链接时找不到某些函数或变量的定义,而这些函数或变量的定义应该在libdblock库中。你需要检查一下编译和链接的命令行中,是否正确地包含了libdblock库,并且是否链接了该库。你可以尝试在编译命令行中添加“-ldbloc”选项,指示链接器链接该库。如果问题仍然存在,你可能需要检查一下该库是否正确地安装了,并且是否包含了需要的函数和变量的定义。
相关问题
将 mpich2-1.0.8.tar.gz 解压缩到 /usr/local/ 目录下
你可以按照以下步骤将 mpich2-1.0.8.tar.gz 解压缩到 /usr/local/ 目录下:
1. 打开终端并进入到下载目录(假设下载目录为 ~/Downloads/):
```
cd ~/Downloads/
```
2. 解压缩 mpich2-1.0.8.tar.gz 文件:
```
tar -zxvf mpich2-1.0.8.tar.gz
```
3. 进入解压缩后的 mpich2-1.0.8 目录:
```
cd mpich2-1.0.8
```
4. 配置安装路径为 /usr/local/:
```
./configure --prefix=/usr/local/
```
5. 编译并安装:
```
make && sudo make install
```
6. 安装完成后,验证是否成功安装:
```
mpicc -version
```
如果成功安装,将会输出 mpicc 的版本信息。
home/zj/OpenFOAM/OpenFOAM-9/etc/config.sh/mpi: line 46: mpicc: command not found什么原因
这个错误提示意味着在你的系统上没有找到 `mpicc` 命令。可能是因为你没有安装 MPI(Message Passing Interface)或者 MPI 没有正确地配置。
你可以尝试安装 MPI,例如 OpenMPI 或 MPICH,然后重新运行你的程序。如果你使用的是 Linux 系统,你可以使用以下命令来安装 OpenMPI:
```
sudo apt-get install openmpi-bin libopenmpi-dev
```
如果你使用的是其他操作系统,请参考对应的 MPI 安装指南。
阅读全文