【问题描述】
鲲鹏环境下编译fio-2.1.10报undefined reference to `major'和undefined reference to `minor'问题,详细报错如下:
/usr/bin/ld: diskutil.o: in function `get_device_numbers':
/home/fio-2.1.10/fio-2.1.10/diskutil.c:184: undefined reference to `major'
/usr/bin/ld: /home/fio-2.1.10/fio-2.1.10/diskutil.c:185: undefined reference to `minor'
/usr/bin/ld: /home/fio-2.1.10/fio-2.1.10/diskutil.c:163: undefined reference to `major'
/usr/bin/ld: /home/fio-2.1.10/fio-2.1.10/diskutil.c:164: undefined reference to `minor'
/usr/bin/ld: diskutil.o: in function `fio_lookup_raw':
/home/fio-2.1.10/fio-2.1.10/os/os-linux.h:170: undefined reference to `major'
/usr/bin/ld: diskutil.o: in function `get_device_numbers':
/home/fio-2.1.10/fio-2.1.10/diskutil.c:160: undefined reference to `major'
/usr/bin/ld: /home/fio-2.1.10/fio-2.1.10/diskutil.c:161: undefined reference to `minor'
/usr/bin/ld: diskutil.o: in function `fio_lookup_raw':
/home/fio-2.1.10/fio-2.1.10/os/os-linux.h:183: undefined reference to `minor'
/usr/bin/ld: blktrace.o: in function `lookup_device':
/home/fio-2.1.10/fio-2.1.10/blktrace.c:160: undefined reference to `major'
/usr/bin/ld: /home/fio-2.1.10/fio-2.1.10/blktrace.c:160: undefined reference to `minor'
collect2: error: ld returned 1 exit status
make: *** [Makefile:270: fio] Error 1
【解决方法】
修改fio.h文件
在第3行增加如下内容
#include <sys/sysmacros.h>
再次执行make编译即可
【问题描述】
鲲鹏环境下编译fio-2.1.10报undefined reference to `major'和undefined reference to `minor'问题,详细报错如下:
/usr/bin/ld: diskutil.o: in function `get_device_numbers':
/home/fio-2.1.10/fio-2.1.10/diskutil.c:184: undefined reference to `major'
/usr/bin/ld: /home/fio-2.1.10/fio-2.1.10/diskutil.c:185: undefined reference to `minor'
/usr/bin/ld: /home/fio-2.1.10/fio-2.1.10/diskutil.c:163: undefined reference to `major'
/usr/bin/ld: /home/fio-2.1.10/fio-2.1.10/diskutil.c:164: undefined reference to `minor'
/usr/bin/ld: diskutil.o: in function `fio_lookup_raw':
/home/fio-2.1.10/fio-2.1.10/os/os-linux.h:170: undefined reference to `major'
/usr/bin/ld: diskutil.o: in function `get_device_numbers':
/home/fio-2.1.10/fio-2.1.10/diskutil.c:160: undefined reference to `major'
/usr/bin/ld: /home/fio-2.1.10/fio-2.1.10/diskutil.c:161: undefined reference to `minor'
/usr/bin/ld: diskutil.o: in function `fio_lookup_raw':
/home/fio-2.1.10/fio-2.1.10/os/os-linux.h:183: undefined reference to `minor'
/usr/bin/ld: blktrace.o: in function `lookup_device':
/home/fio-2.1.10/fio-2.1.10/blktrace.c:160: undefined reference to `major'
/usr/bin/ld: /home/fio-2.1.10/fio-2.1.10/blktrace.c:160: undefined reference to `minor'
collect2: error: ld returned 1 exit status
make: *** [Makefile:270: fio] Error 1
【解决方法】
修改fio.h文件
在第3行增加如下内容
#include <sys/sysmacros.h>
再次执行make编译即可