我正在尝试编译SVGA源以构建共享库对象。 在编译时我收到此错误
make[1]: Entering directory `/home/manmatha/Downloads/svgalib-1.9.25/utils'
gcc -I../include -I. -MM ../utils/restorefont.c ../utils/convfont.c ../utils/restoretextmode.c ../utils/restorepalette.c ../utils/dumpreg.c >.depend
cc -Wall -Wstrict-prototypes -fomit-frame-pointer -O2 -fno-strength-reduce -pipe -I../include -L../sharedlib -c -o restorefont.o restorefont.c
cc -Wall -Wstrict-prototypes -fomit-frame-pointer -O2 -fno-strength-reduce -pipe -I../include -L../sharedlib -s -o restorefont restorefont.o -lvga -lm
chmod 4755 restorefont
cc -Wall -Wstrict-prototypes -fomit-frame-pointer -O2 -fno-strength-reduce -pipe -I../include -L../sharedlib -c -o convfont.o convfont.c
cc -Wall -Wstrict-prototypes -fomit-frame-pointer -O2 -fno-strength-reduce -pipe -I../include -L../sharedlib -s -o convfont convfont.o -lvga -lm
cc -Wall -Wstrict-prototypes -fomit-frame-pointer -O2 -fno-strength-reduce -pipe -I../include -L../sharedlib -c -o restoretextmode.o restoretextmode.c
cc -Wall -Wstrict-prototypes -fomit-frame-pointer -O2 -fno-strength-reduce -pipe -I../include -L../sharedlib -s -o restoretextmode restoretextmode.o -lvga -lm
chmod 4755 restoretextmode
cc -Wall -Wstrict-prototypes -fomit-frame-pointer -O2 -fno-strength-reduce -pipe -I../include -L../sharedlib -c -o restorepalette.o restorepalette.c
cc -Wall -Wstrict-prototypes -fomit-frame-pointer -O2 -fno-strength-reduce -pipe -I../include -L../sharedlib -s -o restorepalette restorepalette.o -lvga -lm
chmod 4755 restorepalette
cc -Wall -Wstrict-prototypes -fomit-frame-pointer -O2 -fno-strength-reduce -pipe -I../include -L../sharedlib -c -o dumpreg.o dumpreg.c
cc -Wall -Wstrict-prototypes -fomit-frame-pointer -O2 -fno-strength-reduce -pipe -I../include -L../sharedlib -s -o dumpreg dumpreg.o -lvga -lm
chmod 4755 dumpreg
cc -Wall -Wstrict-prototypes -fomit-frame-pointer -O2 -fno-strength-reduce -pipe -I../include -L../sharedlib -s -o gtfcalc -DTESTING_GTF gtf/gtfcalc.c -lvga -lm
gtf/gtfcalc.c:67: error: static declaration of ‘round’ follows non-static declaration
make[1]: *** [gtfcalc] Error 1
make[1]: Leaving directory `/home/manmatha/Downloads/svgalib-1.9.25/utils'
make: *** [textutils] Error 2
编辑::是补丁有效..但编译在编译svga_helper.ko模块时遇到下一个错误
/home/manmatha/Downloads/svgalib-1.9.25/kernel/svgalib_helper/main.c:1:26: error: linux/config.h: No such file or directory
/home/manmatha/Downloads/svgalib-1.9.25/kernel/svgalib_helper/main.c:20:35: error: linux/devfs_fs_kernel.h: No such file or directory
In file included from /home/manmatha/Downloads/svgalib-1.9.25/kernel/svgalib_helper/main.c:42:
/home/manmatha/Downloads/svgalib-1.9.25/kernel/svgalib_helper/kernel26compat.h: In function ‘devfs_unregister_chrdev’:
/home/manmatha/Downloads/svgalib-1.9.25/kernel/svgalib_helper/kernel26compat.h:80: error: void value not ignored as it ought to be
/home/manmatha/Downloads/svgalib-1.9.25/kernel/svgalib_helper/main.c: In function ‘svgalib_helper_ioctl’:
/home/manmatha/Downloads/svgalib-1.9.25/kernel/svgalib_helper/main.c:237: warning: cast to pointer from integer of different size
/home/manmatha/Downloads/svgalib-1.9.25/kernel/svgalib_helper/main.c:242: warning: cast to pointer from integer of different size
/home/manmatha/Downloads/svgalib-1.9.25/kernel/svgalib_helper/main.c:247: warning: cast to pointer from integer of different size
/home/manmatha/Downloads/svgalib-1.9.25/kernel/svgalib_helper/main.c:252: warning: cast to pointer from integer of different size
/home/manmatha/Downloads/svgalib-1.9.25/kernel/svgalib_helper/main.c:258: warning: cast to pointer from integer of different size
/home/manmatha/Downloads/svgalib-1.9.25/kernel/svgalib_helper/main.c:264: warning: cast to pointer from integer of different size
/home/manmatha/Downloads/svgalib-1.9.25/kernel/svgalib_helper/main.c:358: error: ‘SA_SHIRQ’ undeclared (first use in this function)
/home/manmatha/Downloads/svgalib-1.9.25/kernel/svgalib_helper/main.c:358: error: (Each undeclared identifier is reported only once
/home/manmatha/Downloads/svgalib-1.9.25/kernel/svgalib_helper/main.c:358: error: for each function it appears in.)
/home/manmatha/Downloads/svgalib-1.9.25/kernel/svgalib_helper/main.c:358: warning: passing argument 2 of ‘request_irq’ from incompatible pointer type
include/linux/interrupt.h:123: note: expected ‘irq_handler_t’ but argument is of type ‘enum irqreturn_t (*)(int, void *, struct pt_regs *)’
/home/manmatha/Downloads/svgalib-1.9.25/kernel/svgalib_helper/main.c: In function ‘svgalib_helper_open’:
/home/manmatha/Downloads/svgalib-1.9.25/kernel/svgalib_helper/main.c:446: error: ‘SA_SHIRQ’ undeclared (first use in this function)
/home/manmatha/Downloads/svgalib-1.9.25/kernel/svgalib_helper/main.c:446: warning: passing argument 2 of ‘request_irq’ from incompatible pointer type
include/linux/interrupt.h:123: note: expected ‘irq_handler_t’ but argument is of type ‘enum irqreturn_t (*)(int, void *, struct pt_regs *)’
/home/manmatha/Downloads/svgalib-1.9.25/kernel/svgalib_helper/main.c: In function ‘init_module’:
/home/manmatha/Downloads/svgalib-1.9.25/kernel/svgalib_helper/main.c:651: error: implicit declaration of function ‘class_device_create’
make[3]: *** [/home/manmatha/Downloads/svgalib-1.9.25/kernel/svgalib_helper/main.o] Error 1
make[2]: *** [_module_/home/manmatha/Downloads/svgalib-1.9.25/kernel/svgalib_helper] Error 2
make[2]: Leaving directory `/usr/src/kernels/2.6.32-358.0.1.el6.x86_64'
make[1]: *** [default] Error 2
make[1]: Leaving directory `/home/manmatha/Downloads/svgalib-1.9.25/kernel/svgalib_helper'
make: *** [installmodule] Error 2
答案 0 :(得分:3)
我认为您想要更新版本的svgalib。 1.4.3很旧,不再维护。如果我没记错的话,还需要修补它以便与更新的编译器一起工作。 尝试使用http://svgalib.org/
中的1.9.x版本之一对于更高版本,如果收到错误:
error: static declaration of 'round' follows non-static declaration
应用以下补丁:
--- svgalib-1.9.25/utils/gtf/gtfcalc.c
+++ svgalib-1.9.25/utils/gtf/gtfcalc.c
@@ -68,5 +68,5 @@
-static double round(double v)
+double round(double v)
{
return floor(v + 0.5);
}
编辑:
使用svga_helper.ko模块中的最新编译问题,将NO_HELPER变量设置为禁用构建svga_helper.ko。从更新的内核中删除了config.h等。从自述文件:
有一个编译时选项可以返回旧的行为,即使用 访问/ dev / mem的root权限,而不是svgalib helper。至 为此编译选择Makefile.cfg中的NO_HELPER选项。