
[英]Why does the function work with float properly but doesn't work with double?
[英]Why does double not work in MINIX 3?
我正在使用MINIX3。我更改了流程计划程序,现在想在那里做一些测试。
问题是,当我想使用double
时,出现错误。 有趣的是,如果我在类的全局double variable
中声明并初始化一个double variable
,则不会显示错误,但是当我想在方法中使用相同的double variable
并尝试编译MINIX 3(版本3.1)时, .6)我收到此错误:
/usr/lib/em_led: /usr/lib/i386/libc.a(exit.o): multiply defined (error)
Undefined:
_test_variable (<---- the name of the variable is "test_variable")
make in /usr/src/kernel: Exit code 1
make in /usr/src/tools: Exit code 1
make: made 'image' look old
当我在/usr/src/tools
使用命令make hdboot
时会发生这种情况,在make install
之后使用
有人知道这是什么问题吗?
已编辑
代码是:
FORWARD _PROTOTYPE( struct proc * pick_proc, (void));
FORWARD _PROTOTYPE( void enqueue_head, (struct proc *rp));
double test_variable;
//(the Variable **test_variable** one is Declared on TOP of the class after the Includes and after the declarations of the Methods
PRIVATE struct proc * pick_proc(void)
{
register struct proc *rp; /* process to run */
int q; /* iterate over queues */
int proceset;
proc_nr_t proci;
if (first_time == 1)
{
test_variable = 6.5;
}
尝试重命名您的变量,并将其也设置为static
。
我不能特别保证与MINIX-3有关,但是我敢打赌,您可能无法在调度程序或任何其他核心子系统,服务器,驱动程序或内核(使用int
或long
)内使用浮点数。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.